Turbopack crashes with SWC plugins when using absolute paths in swcPlugins configuration #78156
Labels
linear: turbopack
Confirmed issue that is tracked by the Turbopack team.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/jantimon/yak-n-run
To Reproduce
require.resolve()
which returns an absolute patha. clone https://github.com/jantimon/yak-n-run
b. (alternative): use require resolve directly
next build --turbopack
Current vs. Expected behavior
Current behavior:
Turbopack immediately crashes with an error message indicating that the plugin path does not exist:
The error message shows the path with a leading dot (e.g.,
./foo/bar/yak-n-run/node_modules/yak-swc/target/wasm32-wasip1/release/yak_swc.wasm
) - so I guess it is trying to resolve it relativelyProvide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 20.18.2 npm: 10.8.2 Yarn: 1.22.22 pnpm: 10.2.0 Relevant Packages: next: 15.3.1-canary.7 // Latest available version is detected (15.3.1-canary.7). eslint-config-next: N/A react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.3 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)
next build (local)
Additional context
✅ Works correctly with webpack (without
--turbopack
)The text was updated successfully, but these errors were encountered: