-
Notifications
You must be signed in to change notification settings - Fork 30k
Description
Link to the code that reproduces this issue
To Reproduce
- build all the packages
pnpm run build - start next js dev server
- You'lee see an error, because server file is transformed
Current vs. Expected behavior
Current behavior
Next.js passes incorrect comments to the swc plugin for server components. It works for client side components
Expected behavior
Next.js passes the correct comment to the swc plugin and everything works as it worked prior to version 16
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Fri, 14 Nov 2025 06:54:20 +0000
Available memory (MB): 31941
Available CPU cores: 16
Binaries:
Node: 25.2.1
npm: 11.6.2
Yarn: N/A
pnpm: 10.23.0
Relevant Packages:
next: 16.0.7 // Latest available version is detected (16.0.7).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.4.5
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
SWC
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I am maintainer of preact-signals library. It's wrapper around preact-signals and is shipped with an swc plugin. The plugin adds useSignals hook to any react component reading something with .value (in auto mode) or just every component in all mode
You can opt-in or opt-out from the transformation using /** @noUseSignals *///** @useSignals */ comments. It worked perfectly fine for client side and server side components. But after I upgraded my test app to the latest Next version it stopped working for client side components
It isn't an issue of swc itself, it handles it with no issues input, output