Jest test runner cannot find fullcalendar modules
See original GitHub issueBug
See this repository for reproduction steps: https://github.com/sgoodrow/test-fullcalendar-v5
Clone and run:
yarn install
yarn test
FAIL src/App.test.js
● Test suite failed to run
Cannot find module '@fullcalendar/react' from 'DemoApp.jsx'
However, Jest was able to find:
'./DemoApp.jsx'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['web.js', 'js', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'./App.css'
'./App.js'
'./App.test.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['web.js', 'js', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
1 | import React from "react";
> 2 | import FullCalendar from "@fullcalendar/react";
| ^
3 | import dayGridPlugin from "@fullcalendar/daygrid";
4 |
5 | export default class DemoApp extends React.Component {
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
at Object.<anonymous> (src/DemoApp.jsx:2:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.985s
This repository was created by:
- Running create-react-app
- Installing the v5 react fullcalendar per these instructions
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:
import React from "react";
import dayGridPlugin from "@fullcalendar/daygrid";
import FullCalendar from "@fullcalendar/react";
You will see Jest get hung up on daygrid
instead:
FAIL src/App.test.js
● Test suite failed to run
Cannot find module '@fullcalendar/daygrid' from 'DemoApp.jsx'
However, Jest was able to find:
'./DemoApp.jsx'
Note also that this does not occur with 4.x.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:16 (5 by maintainers)
Top Results From Across the Web
FullCalendar v6 fails in Jest - angular - Stack Overflow
1",. Proved solutions: Solution 1: "transformIgnorePatterns": [ "/node_modules/(?!@fullcalendar/*).
Read more >test suite failed to run cannot find module jest - You.com
js test suite failed to run cannot find module '@fullcalendar/react' from 'demoapp. jsx' however, jest was able to find: './demoapp.
Read more >@fullcalendar/common | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >react-native-calendars - npm
This module includes various customizable React-Native calendar components. The package is both Android and iOS compatible. See our new Docs site. Try it...
Read more >Angular — How to solve the Full-calendar module loading issue
Import should go first before full-calendar plugins. If it doesn't go well, then you may face an error. Now, in your app's component...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
main
field now. If there are further problems, please open a new ticket.