SIGN IN SIGN UP

fix(bundler-plugins): Keep debug IDs on Vite source maps after the preload rewrite (#24920)

With `sourcemaps.disable: 'disable-upload'`, Vite builds shipped some
source maps without a debug ID. Vite's own `generateBundle` step
rewrites every chunk with a dynamic import to add module preloading,
regenerates that chunk's source map and overwrites the `.map` asset.
This runs after the Sentry plugin's `pre` hook stamped the map, so the
stamp is lost. Sentry then cannot match the map to the chunk.

`sentryVitePlugin()` now also returns a `post` plugin that re-stamps the
maps in a `post` `generateBundle` hook. 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.

---------

Co-authored-by: Anders Chen <anders@wistia.com>
T
Tim Fish committed
e4d6f6460f8db0f89c4cd8fde5706dfe57d1b4e0
Parent: 811af68
Committed by GitHub <noreply@github.com> on 10/1/2026, 1:57:47 PM