Skip to content

fix(nuxt): Nuxt 5 server source maps do not reach the original source files #25323

Open

Description

@s1gr1d

On Nuxt 5, server stack frames resolve to .nuxt/vite/services/ssr/..., not to the .vue and .ts source files.

Root cause

Nuxt 5 builds the server in two steps:

  1. The Vite ssr environment (a Nitro "service") builds the app into .nuxt/vite/services/ssr, with source maps.
  2. The nitro environment bundles that output again into .output/server.

Nitro reads the service output as plain code and ignores the .map files next to it. So the final maps end at the intermediate output and do not chain to the original sources.

Possible fix

TanStack Start with nitro/vite has the same problem. The TanStack Start fix has two parts:

  • In the nitro environment, a load hook returns each service chunk together with its .map, so the bundler composes both maps.
  • The Sentry plugin does not run in the service environment, so the service's debug IDs do not end up in Nitro's output.

The same approach probably works for Nuxt 5. Check how @nuxt/kit scopes Vite plugins to environments: kit 3 and kit 4.6 do this differently.

Tests

In dev-packages/e2e-tests/test-applications/nuxt-5-sourcemaps/assert-build.ts, enable the commented-out assertion that the server maps reach app/pages/index.vue.

Activity

  1. linear-code commented on Oct 13, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions