fix(bundler-plugins): Keep debug IDs on Vite source maps after the preload rewrite - #24920
Merged
Merged
Conversation
…eload rewrite Vite regenerates the source map of every chunk that has a dynamic import in its own generateBundle hook, after the Sentry plugin stamped the map in its pre hook. With sourcemaps.disable set to disable-upload, those maps shipped without a debug ID. A post plugin now re-stamps the maps and leaves the chunk code alone.
…ks with dynamic imports
timfish
marked this pull request as ready for review
October 1, 2026 08:33
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a79f69b. Configure here.
…tures The shared reader zeroes debug IDs in chunks, which hid the comparison with the source map.
msonnb
approved these changes
Oct 1, 2026
timfish
enabled auto-merge (squash)
October 1, 2026 13:26
…s/vite-sourcemap-debug-ids # Conflicts: # packages/bundler-plugins/src/rollup/index.ts
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.

With
sourcemaps.disable: 'disable-upload', Vite builds shipped some source maps without a debug ID. Vite's owngenerateBundlestep rewrites every chunk with a dynamic import to add module preloading, regenerates that chunk's source map and overwrites the.mapasset. This runs after the Sentry plugin'sprehook stamped the map, so the stamp is lost. Sentry then cannot match the map to the chunk.sentryVitePlugin()now also returns apostplugin that re-stamps the maps in apostgenerateBundlehook. It leaves the chunk code alone, so file hashes stay valid. Reproduced on Vite 7.3 and 8.0, and the new integration fixture fails without the fix.Split out of #23665 by @chen-anders.