`swcMinify: true` does not produce an usable build with v12.1.5
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
$ npx --no-install next info
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64
Binaries:
Node: 16.13.1
npm: 8.1.2
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 12.1.5
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
Not relevant
How are you deploying your application? (if relevant)
next start
after a next build
Describe the Bug
Locally (running the application locally, in my IDE), everything looks good. Our tests are green as well. Only the PROD artefact is somehow rubbish.
When accessing the homepage, this is what we get in the console:
When clicking on one of the links displayed, this is what I get:
Expected Behavior
No error messages in the console, application is running properly and swcMinify is set to true
, like it used to be for v12.1.0 (application was NOT working with the releases from v12.1.1 to v12.1.4).
The expected behavior could be achieved if I set swcMinify to false
in the configuration file.
To Reproduce
Kindly follow instructions given in the README.md, Production-like local deployment.
More info on the problem could be found here and there.
Please, let me know if you have questions, or whether I should deeply investigate in a given direction, or if I can do anything here to help.
Thanks in advance for your time and investigation.
Issue Analytics
- State:
- Created a year ago
- Reactions:9
- Comments:42 (18 by maintainers)
Top GitHub Comments
@VeronikaSergiyenko I think it will be fixed by https://github.com/vercel/next.js/pull/36535
React now uses google closure compiler as their minifier, and it triggered a bug of swc minifier. So I disabled the problematic pass for now and I’m working on a full fix for alias analyzer
@seanparmelee
It will be fixed by https://github.com/vercel/next.js/pull/36351
(I used my own script to replace
next-swc
binary)