New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest test runner cannot find fullcalendar modules #5467
Comments
I'm also facing a very similar issue and as far as I can tell this was introduced with beta3 and is related to the change from See the diff: 2,3c2,3
< "_from": "@fullcalendar/core@5.0.0-beta.2",
< "_id": "@fullcalendar/core@5.0.0-beta.2",
---
> "_from": "@fullcalendar/core@5.0.0-beta.3",
> "_id": "@fullcalendar/core@5.0.0-beta.3",
5c5
< "_integrity": "sha512-9U/kk8Y4ackY1XZ1PHvX8rG1olixoKveStXdDsX3FCtKATR8fA/O+4Pd5qyH7nGcih8TrgreUjZ+dB+DEaomqQ==",
---
> "_integrity": "sha512-oZrxSbtti67V/6h+Jy1bvbwQqOozxuuuH+wO53KKXAd2hyLLmZcJTZ/6aFdtlVEbo2AUN/QD030sbsQSQvasZg==",
11c11
< "raw": "@fullcalendar/core@5.0.0-beta.2",
---
> "raw": "@fullcalendar/core@5.0.0-beta.3",
15c15
< "rawSpec": "5.0.0-beta.2",
---
> "rawSpec": "5.0.0-beta.3",
17c17
< "fetchSpec": "5.0.0-beta.2"
---
> "fetchSpec": "5.0.0-beta.3"
23,26c23,26
< "_resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-5.0.0-beta.2.tgz",
< "_shasum": "30a9cbbbf2d6476568f53cfa1c0746d06daa9660",
< "_spec": "@fullcalendar/core@5.0.0-beta.2",
< "_where": "/Users/georgehrke/Desktop/fc-test/2",
---
> "_resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-5.0.0-beta.3.tgz",
> "_shasum": "9f1b3ab22d687ef584fff18bb25d80f71035aef6",
> "_spec": "@fullcalendar/core@5.0.0-beta.3",
> "_where": "/Users/georgehrke/Desktop/fc-test/3",
37a38
> "@fullcalendar/common": "5.0.0-beta.3",
45,49d45
< "keywords": [
< "calendar",
< "event",
< "full-sized"
< ],
51c47
< "main": "main.js",
---
> "module": "main.js",
57a54
> "sideEffects": true,
60c57
< "version": "5.0.0-beta.2"
---
> "version": "5.0.0-beta.3" |
According to one of the maintainers of import-js/eslint-plugin-import#1509 (comment) @arshaw ^ |
It sounds like there is some issue here, but I wasn't able to reproduce the error. When I try I also tried following the steps manually: npx create-react-app my-app
cd my-app
npm install --save @fullcalendar/react@5.0.0-beta.4 @fullcalendar/core@5.0.0-beta.4 @fullcalendar/daygrid@5.0.0-beta.4
yarn install
yarn test That gets me to a prompt where I can press "a" to run all tests, then the one test runs and it passes. Let me know if I missed something or how to reproduce the error. |
Ah, shoot. Let me fix the package-lock, sorry about that. |
I pushed a fix. Sorry about that @acerix, forgot I had an internal NPM registry set on the computer I generated the lockfile from. |
Interesting that your steps to reproduce did not elicit the same behavior... 🤔 I'll have to dig in a bit more then, thanks for checking. |
Oh, @acerix you missed the step where you need to import one of the fullcalendar modules into These steps repro:
error
|
Any chance this will be reopened? Happy Monday 😁 |
Thanks for the info, I was able to reproduce the error. It seems like it may be an issue specific to Jest. |
in the |
Is there a known workaround for this that I can implement temporarily? |
This is released in the v5 release candidate All packages simply use a |
Same repo, same commands, similar error:
Reproduce:
|
@chriswall-aa, that is due to Jest not supporting ES6 modules very well. It's rather easy to add babel to your own testing code to have it transpile ESM to CJS, but you'll also need to add it for ./node_modules/@fullcalendar/* |
It's that node doesn't support ES6 modules and jest runs on node. A convention I've seen/used for this is to output an
jest running on node will pull in soon, we'll all live in a world where we can drop commonjs and use |
Agree with @duhseekoh. I was stuck on this for the entire day today trying to make it work, still with no solution. I don't use next.js so cannot do what other issues suggest. Please output two variants. github.com/elastic/ui does it so there's a good example. |
Bug
See this repository for reproduction steps: https://github.com/sgoodrow/test-fullcalendar-v5
Clone and run:
yarn install
yarn test
This repository was created by:
React/Vue/Angular/etc
I happen to be using React, but the import error occurs for the plugin files, too, so this is a broader issue than just the React connector. AKA, if you change the import order:
You will see Jest get hung up on
daygrid
instead:Note also that this does not occur with 4.x.
The text was updated successfully, but these errors were encountered: