Skip to content
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

Apple M1 – Issue w/ @babel/runtime/helpers/interopRequireDefault.js error w/ NextJS, unable to use component #2153

Closed
4 of 5 tasks
gavgrego opened this issue Mar 20, 2022 · 7 comments · Fixed by #2155
Closed
4 of 5 tasks

Comments

@gavgrego
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://github.com/gavgrego/dead-cal

Bug description

When trying to use component on a page with NextJS get an error related to /home/runner/work/react-big-calendar/react-big-calendar/node_modules/@babel/runtime/helpers/interopRequireDefault.js

`error - Error: Cannot find module '/home/runner/work/react-big-calendar/react-big-calendar/node_modules/@babel/runtime/helpers/interopRequireDefault.js'
Require stack:

  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/react-big-calendar/lib/index.js
  • /Users/gavin/Sites/cal-dead/cal-dead/.next/server/pages/index.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/server/require.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/server/load-components.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/build/utils.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/build/output/store.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/build/output/index.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/cli/next-dev.js
  • /Users/gavin/Sites/cal-dead/cal-dead/node_modules/next/dist/bin/next`

Expected Behavior

No response

Actual Behavior

No response

react-big-calendar version

0.36.4

React version

0.36.4

Platform/Target and Browser Versions

macOS M1

Validations

  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a react-big-calendar issue and not an implementation issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@gavgrego gavgrego added the bug label Mar 20, 2022
@wayimp
Copy link

wayimp commented Mar 20, 2022

I encountered this exact same issue with my Next.js project.

@darraghmckay
Copy link

darraghmckay commented Mar 21, 2022

Reverting to v0.39.3 solved the issue for me as a workaround

@cutterbl
Copy link
Collaborator

So, you do not see a @babel/runtime folder in your node_modules? It is a dependency of Big Calendar.

@runofthemillgeek
Copy link
Contributor

@cutterbl I have encountered this as well and I believe "absoluteRuntime": false needs to be passed for babel-preset-react-app. Have documented the changes in #2155 — let me know if this does it.

@github-actions
Copy link

🎉 This issue has been resolved in version 0.39.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gavgrego
Copy link
Author

@Sangeeth69 @cutterbl looks like this just introduced a new bug, still not working for me.

Error: require() of ES Module /Users/gavin/Sites/cal-dead/cal-dead/node_modules/@babel/runtime/helpers/esm/objectSpread2.js from /Users/gavin/Sites/cal-dead/cal-dead/node_modules/react-big-calendar/lib/Calendar.js not supported. Instead change the require of objectSpread2.js in /Users/gavin/Sites/cal-dead/cal-dead/node_modules/react-big-calendar/lib/Calendar.js to a dynamic import() which is available in all CommonJS modules.

@runofthemillgeek
Copy link
Contributor

Hey @gavgrego and others. Sorry, npm was giving issues yesterday so I couldn't test a possible fix for the issues you're facing. But could you check #2156 (comment) and maybe any further discussions on this can go in #2156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants