-
Notifications
You must be signed in to change notification settings - Fork 27k
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 > 13.4.10 too aggressive tree shaking #53286
Comments
This is an SWC issue. AFAIK, it has already been reported upstream to the SWC repository. |
Seems like it, but I get the same result with |
Really? There was a repository on one of those issues, and it worked with minify turned off. Mmm 🤔 yours uses app router, wonder if that changes things. Could you try with pages router? |
Sorry, I was wrong, |
This will be fixed by swc-project/swc#7702 |
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. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 Binaries: Node: 19.6.0 npm: 9.4.0 Yarn: N/A pnpm: 8.5.0 Relevant Packages: next: 13.4.9 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
webpack optimization I guess
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Torsten85/next-13-4-10-tree-shaking-bug
To Reproduce
run
pnpm i && pnpm test
, see the error (13.4.13-canary.5)run
git checkout downgrade && pnpm i && pnpm test
, see no error (13.4.9)Describe the Bug
SWC minify removes a used chunk of code from a dependency, resulting in a production error
Expected Behavior
the bundling process should correctly determine that the code block is referenced and in use
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: