nextjs - 💡(How to fix) Fix mismatched turbopack source maps [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85471Fetched 2026-04-08 02:15:33
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1issue_type_added ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:15:09 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.0.1-canary.6 // Latest available version is detected (16.0.1-canary.6).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/thomaspage/next16sourcemaps

To Reproduce

build the app and look in /.next/static directory

Current vs. Expected behavior

current behaviour:

  1. build app
  2. look in /.next/static/*
  3. source maps do not match js files

expected behaviour:

  1. build app
  2. look in /.next/static/*
  3. source maps do match js files

notes:

  • enabling webpack with next build --webpack and re-running build results in expected behaviour (.js files match .js.map files)
  • appeared in v16, still present latest canary version

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:15:09 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 16.0.1-canary.6 // Latest available version is detected (16.0.1-canary.6).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.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

No response

extent analysis

TL;DR

Enabling webpack with next build --webpack may serve as a temporary workaround to ensure source maps match js files.

Guidance

  • The issue seems to be related to Turbopack in Next.js version 16, as enabling webpack resolves the mismatch between source maps and js files.
  • To verify the issue, build the app and compare the source maps in the /.next/static directory with the expected output.
  • Try using the --webpack flag with next build to see if it produces the expected behavior, as it has worked for the reporter.
  • Investigate if there are any open issues or discussions related to Turbopack and source map generation in Next.js version 16.

Example

No specific code snippet is provided as the issue seems to be related to the build process and configuration rather than a specific code block.

Notes

The provided information suggests that this issue is specific to Next.js version 16 and Turbopack. The workaround using --webpack flag may not be a permanent solution and might have performance implications.

Recommendation

Apply workaround: Use next build --webpack as a temporary solution until the issue is resolved in a future version of Next.js, as it currently ensures source maps match js files.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING