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
Next 12.2 ReferenceError: exports is not defined #38117
Comments
@hanford Try to rename the |
@SukkaW that triggers a different error: |
@hanford The issue is caused by you trying to mix ES Module and CommonJS files.
|
We're running into the same thing. It was working before on version 12.1.6. |
Same here, was working fine with previous version. |
We fixed it by changing |
Can confirm that this was working before 12.2, we use next-transpile-modules to bring in mixed modules and they worked just fine up until 12.2 |
Tried bisecting the commit using https://github.com/hanford/12.2-exports as test and got this
Setting the |
Is there a way to set this thought |
Nope, you can use patch-package if you want using this patch (
|
Why does vercel change my js file ? It adds "use strict" and undo my minification. |
add .babelrc without changing any configuration |
@weiguanu having a |
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) --- - Closes #38117
Woot, excited for the next canary! 🖤 |
Yay! Thank you @kdy1! |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Next 12.2(-12.2.2)
Describe the Bug
I'm no longer able to import code with
exports
properly in Next 12.2Expected Behavior
Next should properly bundle these files
Link to reproduction
https://github.com/hanford/12.2-exports
To Reproduce
Pull reproduction repo and try running on Next
12.2.0
, you'll see the following error:You can check out the
working
branch, which just has Next12.1.6
, after installing the older version the code will run without error.--
Happy to provide more information if it's helpful!
The text was updated successfully, but these errors were encountered: