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

CommonJS error on Nextjs 15 and React 19 #162

Closed
Kazizodev opened this issue Dec 27, 2024 · 7 comments
Closed

CommonJS error on Nextjs 15 and React 19 #162

Kazizodev opened this issue Dec 27, 2024 · 7 comments
Labels

Comments

@Kazizodev
Copy link

Getting this error after the latest update v6.2.1

  ./node_modules/.pnpm/react-confetti@6.2.1_react@19.0.0/node_modules/react-confetti/dist/index.js
Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)
The CommonJs module format was specified in the package.json that is affecting this source file or by using an special extension, but Ecmascript import/export syntax is used in the source code.
The module was automatically converted to an EcmaScript module, but that is in conflict with the specified module format. Either change the "type" field in the package.json or replace EcmaScript import/export syntax with CommonJs syntas in the source file.
In some cases EcmaScript import/export syntax is added by an transform and isn't actually part of the source code. In these cases revisit transformation options to inject the correct syntax.

This is only happening after upgrading to 6.2.1

@Lermatroid
Copy link

+1. Same happening here.

@DennisSmolek
Copy link

Just saw this too on Next 14 actually (trying to upgrade to 15 now)

I think this is related: vercel/next.js#74062

@alampros
Copy link
Owner

Thanks for reporting. I'll try to get a test repo in next set up today.

github-actions bot pushed a commit that referenced this issue Dec 28, 2024
## [6.2.2](v6.2.1...v6.2.2) (2024-12-28)

### Bug Fixes

* build multiple module types ([3be757d](3be757d)), closes [#162](#162) [#158](#158)
Copy link

🎉 This issue has been resolved in version 6.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@alampros
Copy link
Owner

Verified that it works in nextjs (and with turbopack):
CleanShot 2024-12-28 at 08 33 46@2x

@Kazizodev
Copy link
Author

Amazing thanks! Works perfectly

@Lermatroid
Copy link

Thanks @alampros! Working excellent on my end.

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

No branches or pull requests

4 participants