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

Use import for objectSpread2.js #2156

Closed
4 of 5 tasks
wayimp opened this issue Mar 22, 2022 · 3 comments · Fixed by #2157
Closed
4 of 5 tasks

Use import for objectSpread2.js #2156

wayimp opened this issue Mar 22, 2022 · 3 comments · Fixed by #2157

Comments

@wayimp
Copy link

wayimp commented Mar 22, 2022

Check that this is really a bug

  • I confirm

Reproduction link

Latest release (today)

Bug description

Crashes with Error: Must use import to load ES Module:
@babel/runtime/helpers/esm/objectSpread2.js
require() of ES modules is not supported.
require() of @babel/runtime/helpers/esm/objectSpread2.js
from react-big-calendar/lib/Calendar.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename objectSpread2.js to end in .cjs, change the requiring code to use import()

Expected Behavior

Not blow up

Actual Behavior

Blows up

react-big-calendar version

0.39.5

React version

17.0.2

Platform/Target and Browser Versions

using Next.js

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
@runofthemillgeek
Copy link
Contributor

Hey @wayimp, could you try testing the fix in #2157 by changing your package.json dependency to the following:

{
  "dependencies": {
    "react-big-calendar": "git+https://github.com/sangeeth96/react-big-calendar#fix/babel-dist-lib-no-esm--dist"
  }
}

and see if this fixes the issue?

@github-actions
Copy link

🎉 This issue has been resolved in version 0.39.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wayimp
Copy link
Author

wayimp commented Mar 23, 2022

I tried to test this like you asked, but my build still failed, and then I got distracted on another task. Thank you for releasing a fix so quickly. It's all good now.

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.

2 participants