Repository navigation
Conversation
Nitro 3 bundles the output of Nuxt 5's ssr build (.nuxt/vite/services/ssr) again, but loads it without the .map files next to it. So server stack frames stop at that output instead of the .vue and .ts files. Nuxt's own SourcemapPreserverPlugin does not chain the maps when Nitro builds as a Vite environment. Until Nuxt fixes this, return each service chunk together with its map from a load hook in the Nitro build. Fixes #25323
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Nuxt 5, server stack frames resolve to
.nuxt/vite/services/ssr/..., not to the.vueand.tsfiles. Nitro 3 bundles the output of thessrbuild again, but it loads that output without the.mapfiles next to it, so the final maps stop there. The module now adds aloadhook to the Nitro build. For each file in<buildDir>/vite/services/that has a.map, the hook returns the code with its map, and the bundler chains both maps. On Nuxt 3 and 4, this directory does not exist, so the hook does nothing.This is a workaround. Nuxt has a plugin for this (
SourcemapPreserverPlugin), but it adds its load hook only when Nitro does not build as a Vite environment. Its code comment says there is no second bundling pass in that mode, but there is one. When Nuxt fixes this, we can remove the hook.The issue also asks to keep the Sentry Vite plugin out of the
ssrservice. No change is needed for that:@nuxt/kit4.6 scopesaddVitePlugin(..., { server: false })to theclientenvironment, and the existing "one debug ID per file" E2E check covers it.The assertion in
nuxt-5-sourcemapsthat the server maps reachapp/pages/index.vueis enabled again.Fixes #25323