-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/WooWan/yarn-pnp-sourcemap-repro/tree/main
To Reproduce
- Start the application in development (yarn dev)
- Open Chrome DevTools → Sources tab
- Look for
next/dist/client/components/app-router.js - Instead of seeing original
.tssource files, the bundled.jsfiles are shown
Current vs. Expected behavior
Current: In Yarn PnP mode, DevTools shows .js files instead of original .ts sources for Next.js internal runti
+me files (next/dist/client/, next/dist/shared/lib/, next/dist/pages/). inputSourceMap is not passed to the SWC
+ loader, so source map chaining is broken.
Expected: DevTools should show .ts source files, same as non-PnP mode.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:53:15 PST 2026; root:xnu-12377.81.4~5/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 24.6.0
npm: 11.5.1
Yarn: 4.12.0
pnpm: N/A
Relevant Packages:
next: 16.1.6
eslint-config-next: N/A
react: 19.2.3
react-dom: 19.2.3
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Webpack, SWC
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.