Link to the code that reproduces this issue
https://github.com/albert4719/turbopack-deadcode-repro
To Reproduce
- npm install
- npm run build
- grep the compiled action chunk in .next/server/chunks/ssr — the code after the switch is gone
Current vs. Expected behavior
A server action with a switch (one empty case + break, and default returning the same value as another case) loses all code after the switch in next build. It returns undefined for the empty case. Works fine in next dev. Details +
de-minified output in the repo README.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Available memory (MB): 65179
Available CPU cores: 32
Binaries:
Node: 26.2.0
npm: 11.13.0
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 16.2.9 // Latest available version is detected (16.2.9).
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: N/A
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
Other (Deployed), next start (local)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/albert4719/turbopack-deadcode-repro
To Reproduce
Current vs. Expected behavior
A server action with a switch (one empty
case+ break, anddefaultreturning the same value as another case) loses all code after the switch innext build. It returns undefined for the empty case. Works fine innext dev. Details +de-minified output in the repo README.
Provide environment information
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
Other (Deployed), next start (local)
Additional context
No response