-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
swcMinify: true leads to "Expected ident" Webpack/Terser error #30053
Comments
looks like swc-project/swc#2486 edit: seems to be released in latest canary |
oh nice! |
So i updated to the latest canary, now i don't see that error, but instead i see this:
Any idea what can be done to deal with this issue? |
Provide a reproduction so it can be debugged |
@Janpot the whole point is that i don't know how to reproduce this since i don't understand at all where these errors are coming from :/ I tried remaking a NextJS app with the same configuration and this didn't happen, so I am lost. Hence my offer to give access to my company's codebase, I don't know what is causing these issues. |
OK I was able to make it stop failing by removing I thought that |
@osdiab did you resolve this problem? |
By turning off |
Hey, I've opened a PR to have a debug flag that logs all sources before minification. Once that is out on canary could you please run your app using it and get the source for the file that is breaking, then we can investigate and fix the issue 🙏 PR: #31417 |
This is released as https://github.com/vercel/next.js/releases/tag/v12.0.4-canary.13 which can be installed using
|
Happy to, will run this soon! |
Forgot to mention the last step, which is sending the log here or if it can't be shared publicly sending it to me on https://twitter.com/timneutkens |
sent you a DM on Twitter! |
still getting the same error even after bumping to 12.1
it only goes away after I add optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
}, to my next.config seems to fix it, but i dont think this is proper since |
This should be fixed, as the swc minifier has module mode (false by default) and ES codegen bugs are resolved. |
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. |
What version of Next.js are you using?
11.1.3-canary.81
What version of Node.js are you using?
14.16.1
What browser are you using?
Firefox
What operating system are you using?
macOS
How are you deploying your application?
next dev/next build/Vercel
Describe the Bug
I opted into the SWC compiler
and am getting this error when I try to runyarn build
:Now, I'm getting an issue with Terser, that seems to go away when I remove
swcMinify: true
from mynext.config.js
Previous issue
Expected Behavior
No errors on yarn build
To Reproduce
I'm not sure what it is about this project that causes the issue - it's a nextJS project that uses Emotion with the CSS prop - I tried making a similar repro project but it doesn't fail like this, so I'm happy to grant access to my company's codebase to see if there's somethign I'm doing wrong, but here's some data:
Language: Typescript 4.4.3
next.config.js
Relevant Deps
The text was updated successfully, but these errors were encountered: