-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Setting swcMinify: true
in production causes a client-side exception
#46887
Comments
Having a same issue. |
Me neither. Still using next.js with Seems like the bug is due to the duplicated identifier from minified code. |
We started experiencing a TypeError from another package after upgrading to |
Yes, this problem seems to have returned in |
@huozhi sure, a reproduction example can be found here: https://github.com/daanboer/next-citationjs-repro. |
Sorry for duplicated tagging, forgot to mention we're already investigating that one. Asking @\kcrwfrd 's case to see if it's a different case 🙏 thanks! |
My encounter with the bug involved another package so I don't have it isolated very well, but I can put something together @huozhi |
@huozhi okay I just successfully put together a reproduction: https://github.com/kcrwfrd/next-swc-minify-bug-reproduction Thanks for looking into it 🙏🏼 |
swc-project/swc#8956 will fix this issue, and the issue reported by @kcrwfrd will be fixed by swc-project/swc#8957. Thank you for reporting and creating a repro! Fixing a minifier bug is nearly impossible without a good repro. |
…s a ref (#8956) **Description:** Repro: - https://github.com/kdy1/repro-next-46887 **Related issue:** - vercel/next.js#46887
**Description:** - Repro: https://github.com/kdy1/repro-next-46887-2 **Related issue:** - vercel/next.js#46887 (comment)
### Description - Closes PACK-3042 - Closes NEXT-3241 - Closes NEXT-3242 - Closes vercel/next.js#46887 - Closes vercel/next.js#65064 - Closes vercel/next.js#65066 - Closes vercel/next.js#65237 ### Testing Instructions See [next.js counterpart](vercel/next.js#65450)
@kdy1 Thank you for treating this issue. I have updated the reproduction example to use the latest canary release ( |
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. |
### Description - Closes PACK-3042 - Closes NEXT-3241 - Closes NEXT-3242 - Closes vercel/next.js#46887 - Closes vercel/next.js#65064 - Closes vercel/next.js#65066 - Closes vercel/next.js#65237 ### Testing Instructions See [next.js counterpart](vercel/next.js#65450)
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1-NixOS SMP Wed Feb 22 11:57:12 UTC 2023 Binaries: Node: 18.14.2 npm: 9.5.0 Yarn: N/A pnpm: 7.26.3 Relevant packages: next: 13.2.4-canary.5 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
SWC minifier (swcMinify: true)
Link to the code that reproduces this issue
https://github.com/daanboer/next-citationjs-repro
To Reproduce
Setup and run the example code using:
Then visit
localhost:3000
. This will issue a client-side exception, and the formatted citation is not shown.Describe the Bug
Using the
@citation-js/core
, and@citation-js/plugin-csl
packages to format a CSL-json document results in a client-side exception when combined withswcMinify: true
. DisablingswcMinify
results in the desired behavior and the formatted citation is shown without any errors. This bug only occurs in production, enablingswcMinify
in the dev environment works just fine.Expected Behavior
The generated page should not issue any errors and show a formatted citation.
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: