Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
The `.next/standalone/` output folder doesn't contain any sourcemaps | GoodFirstPicks

The `.next/standalone/` output folder doesn't contain any sourcemaps

vercel/next.js 4 comments 1mo ago
View on GitHub
lowopenScope: somewhat clearSkill match: maybeTest focusedNext.jsTypeScriptReact

Why this is a good first issue

Sourcemaps are not being copied to the standalone output folder.

AI Summary

The issue involves sourcemaps not being copied to the `.next/standalone/` folder during the build process. The problem is reproducible and affects debugging. The fix likely involves modifying the build process to include sourcemaps in the standalone output.

Issue Description

Link to the code that reproduces this issue

https://github.com/afgomez/test-next

To Reproduce

Not all sourcemaps are copied over when building a standalone build.

~/code/test-next[main]% pnpm run build
~/code/test-next[main]% find .next/standalone/.next/server/chunks -name '*.js.map' | wc -l
       0
~/code/test-next[main]% find .next/server/chunks -name '*.js.map' | wc -l
      27

However, the copied files do reference a sourcemap

~/code/test-next[main]% grep -r sourceMappingURL .next/standalone/.next/server/chunks | wc -l
      27

Current vs. Expected behavior

Expected:

  • All sourcemaps are copied into the standalone/ folder.

Actual:

  • No sourcemaps are copied into the standalone/ folder.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 25.6.1
  npm: 11.9.0
  Yarn: 1.22.22
  pnpm: 10.29.3
Relevant Packages:
  next: 16.2.0-canary.37 // Latest available version is detected (16.2.0-canary.37).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Output

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

I can also reproduce this issue in Next 16.1.5.

I could not find anything in the docs mentioning that this is expected behaviour, or that it is configurable in any way.

I noticed because we run the app with node --enable-source-maps, but the stack traces still contained references to minified files. A fix for this issue will make my debugging sessions much easier 🙇

GitHub Labels

Output

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • requires understanding of Next.js build process
Loading labels...

Details

Points10 pts
Difficultylow
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes