Skip to content

fix(nuxt): Keep sourcesContent in Nuxt 5 server source maps - #25325

Open
s1gr1d wants to merge 1 commit into
developfrom
fix/nuxt-5-server-sourcescontent
Open

s1gr1d wants to merge 1 commit into
developfrom
fix/nuxt-5-server-sourcescontent

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Oct 13, 2026

Copy link
Copy Markdown
Member

On Nuxt 5 (Nitro 3), the uploaded server source maps have no sourcesContent, so Sentry cannot show the source code for server frames. Nitro's nitro:sourcemap plugin deletes sourcesContent in generateBundle, after the bundler wrote it, so the module's sourcemapExcludeSources: false has no effect. The module now also sets nitro.experimental.sourcemapMinify: false. Nuxt 5 passes the nitro:config result directly to createNitro, so the option reaches Nitro 3.

The setting is not limited to Nitro 3. Nitro 2 has the same option, and its plugin clears mappings of every server map with at least one node_modules source. On Nuxt 3 and 4, such maps now keep their mappings. In the nuxt-4-sourcemaps app, this applies to 7 of 16 server maps. The uploaded maps get larger, but by default Sentry deletes them after the upload.

The setting is always applied, also when the user set it. Nitro types the option as sourcemapMinify?: false, so false is the only value a user can set.

The SERVER_MARKER assertion in nuxt-5-sourcemaps is enabled again.

Fixes #25322

Nitro's source map minification runs after the bundler writes the maps.
On Nitro 3 it deletes sourcesContent, which overrides the module's
sourcemapExcludeSources: false. Set nitro.experimental.sourcemapMinify
to false so Sentry can show the server source.

Fixes #25322
@s1gr1d
s1gr1d marked this pull request as ready for review October 13, 2026 15:29
@s1gr1d
s1gr1d requested a review from a team as a code owner October 13, 2026 15:29
@s1gr1d
s1gr1d requested review from JPeer264, mydea and nicohrubec and removed request for a team October 13, 2026 15:29
@s1gr1d

s1gr1d commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 3e25ccd. Configure here.

@JPeer264
JPeer264 added this pull request to stack #25366 October 14, 2026 13:08

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I added a PR in the stack that also fixes that for Cloudflare.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(nuxt): Nuxt 5 server source maps have no sourcesContent

2 participants