-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
SWC Transpilation/Minification generates wrong code #58959
Comments
Confirming this bug on nextjs ^14.0.3 I use crypto-js to generate a md5 hash for API call and randomized filename on a form submit function.
|
I think I am getting a similar issue because of the transpilation/minification, although I am not using crypto-js. On 14.0.3 I'm getting this on a specific page, only in production:
On dev mode, it works fine. If I downgrade back to 14.0.1 it works fine in both dev and prod. So I think it's related to this issue. |
Closing as fixed by #58517 |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/milap1296/swc-minify-issue
To Reproduce
I am using crypto-js as a dependency and while performing swc-minification it generates a wrong code.
Works correctly in dev environment
Works incorrectly in production with swcMinify:true
Error might be because of this Math = Math assignment in the minified code!
Works incorrectly in production with swcMinify:false
Current vs. Expected behavior
It should not throw exception in production and should work like it is in development mode.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
SWC transforms
Additional context
No response
The text was updated successfully, but these errors were encountered: