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

Abierto
#25,323 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #25333 de @s1gr1d — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
15/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
nuxt, typescript, vite

Línea de trabajo

Start with the e2e fixture at dev-packages/e2e-tests/test-applications/nuxt-5-sourcemaps/assert-build.ts and enable the commented-out check that server maps reach app/pages/index.vue. The payload says the Nitro environment ignores the service .map files, so the work is in how Vite environments and @nuxt/kit scope plugins, which needs the Nuxt 5 build to be understood first. A linked open pull request (#25333) already exists, so check it before starting. Done means the assertion passes against a real build.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
8.8k
Forks
1.9k
Merge medio
1 d 8 h
PR fusionados (30 d)
744

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-javascript

Todos los issues de getsentry/sentry-javascript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.