Minifier too agressive deletes used code #53723
Labels
bug
Issue was opened via the bug report template.
linear: turbopack
Confirmed issue that is tracked by the Turbopack team.
locked
SWC
Related to minification/transpilation in Next.js.
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: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 13.4.14-canary.0 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)
SWC minifier (swcMinify: true), SWC transpilation
Link to the code that reproduces this issue or a replay of the bug
https://github.com/santialbo/next-swc-issue
To Reproduce
Create a basic next app
Create a
/pages
component like the followingRun
yarn build
and inspect.next/chunks/pages/{chunk of the used page}
, the following will be generated:The previous
foo
object gets compiled intoNotice property
get b
is missing! The resulting string isa undefined
instead ofa b
;Describe the Bug
The minifier is too agressive eliminating dead code which is not actually dead.
I noticed this error in my codebase when I upgraded from
13.4.9
to13.4.13
Expected Behavior
Don't delete actually used property.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1502
The text was updated successfully, but these errors were encountered: