Skip to content

[Nuxt] Inject debug IDs and release only at build-end #18974

Description

@s1gr1d

Description

Problem

Nuxt runs through the build twice (client and server).

  1. Nuxt builds client-side
  2. Nuxt builds server-side
  3. Now all client and server files in .nuxt/dist contain one debug ID
  4. Nitro builds server-side
  5. The whole build output is moved to .output and the server-side files which were already included in .nuxt/dist/server (the Nuxt build) are touched by the rollup plugin a second time.

This setup causes the Nuxt SDK to include the Vite and the Rollup plugin, so all source map files are uploaded. However, this has some drawbacks:

  • build-times are longer (as there are more uploads during the build)
  • Source-mapping might cause problems because some files are touched twice (by Nuxt and Nitro) (related issue - however, this was fixed with a workaround that checks if a file already contains a debug ID)
  • release injection happens twice in some files

Solution

By using the Bundler Plugin Manager, we can do everything (debug
ID and release injection) at the end of the build.

Activity

  1. self-assigned this
    on Jan 26, 2026
  2. linear commented on Jan 26, 2026

    @linear
  3. andreyshivas commented on Sep 30, 2026

    @andreyshivas

    Is this still planned? The check from getsentry/sentry-javascript-bundler-plugins#827 doesn't fully fix #18519. It reproduces on a fresh Nuxt 4.5.2 app (4 pages) with @sentry/nuxt 10.71.0 and 11.1.0:

    • 13 of 23 files in .output/server keep only the Vite chunk's debug ID. The snippet is within the first 6000 chars, so Nitro skips its own, and two different files with different source maps get uploaded under one ID.
    • chunks/virtual/entry.mjs ends up with 5 IDs: Nitro's own plus 4 Vite ones further down. The last registered Vite ID wins.

    Either way, server frames resolve with another file's source map. In our app the wrong location shifts with every build, so the same server error opens a new issue on every release.

    Registering the Vite plugin for the client only (server: false in the addVitePlugin call in setupSourceMaps) fixes it on both versions: each server file gets exactly one debug ID of its own.

  4. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 30, 2026
  5. s1gr1d commented on Oct 2, 2026

    @s1gr1d
    MemberAuthor

    Hi,
    Thanks for sharing the problem you're facing. I'm gonna take another look at this!

  6. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 2, 2026
  7. added 2 commits that reference this issue on Oct 6, 2026
    d79f44c
    e9631e2
  8. s1gr1d commented on Oct 6, 2026

    @s1gr1d
    MemberAuthor

    Fix will be released in 11.5.0 and 10.76.1

  9. added a commit that references this issue on Oct 6, 2026
    2cf2dd0
  10. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #25080, which was included in the 11.5.0 release.

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

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions