question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest test runner cannot find fullcalendar modules

See original GitHub issue

Bug

See this repository for reproduction steps: https://github.com/sgoodrow/test-fullcalendar-v5

Clone and run:

  1. yarn install
  2. 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:

  1. Running create-react-app
  2. 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Jun 8, 2020

Is there a known workaround for this that I can implement temporarily?

2reactions
arshawcommented, Jun 16, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found