You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
Cater for when bundlers have already injected Debug IDs #710
So it doesn't look like we'll be able to fix this very easily with Vite because Vite calls the plugins before the debugId and sourcemap comments have been determined or injected!
Rollup
Same goes for Rollup. Rollup injects the debug IDs during the Render Chunks stage but this is after our plugins renderChunks has been called.
Webpack
Our webpack plugin currently injects the debug ID polyfill using the BannerPlugin. If we're going to fix this in webpack we'll need a custom plugin that comes after the sourcemap plugin. I think we're going to see similar issues as above because once sourcemaps have been generated, you don't really want to be modifying the code!
All the bundlers are injecting debug IDs as the very last stage which was the right call, it just makes it hard for us to capture these and inject our polyfill because the output has already been determined.
Alternative options?
We could generate the Debug IDs using the same code that the bundlers are using. That way, the debug IDs would match the bundler?
I have an idea. We can update our plugins to simply write over the existing debug ID comment with the debug ID that was injected within the snippet right before uploading. We are already injecting a "pattern-matchable" string for exactly this purpose with e._sentryDebugIdIdentifier="sentry-dbid-${debugId}"
We can update our plugins to simply write over the existing debug ID comment with the debug ID that was injected within the snippet right before uploading
Activity
timfish commentedon Apr 26, 2025
Vite
So it doesn't look like we'll be able to fix this very easily with Vite because Vite calls the plugins before the debugId and sourcemap comments have been determined or injected!
Rollup
Same goes for Rollup. Rollup injects the debug IDs during the Render Chunks stage but this is after our plugins
renderChunkshas been called.Webpack
Our webpack plugin currently injects the debug ID polyfill using the
BannerPlugin. If we're going to fix this in webpack we'll need a custom plugin that comes after the sourcemap plugin. I think we're going to see similar issues as above because once sourcemaps have been generated, you don't really want to be modifying the code!All the bundlers are injecting debug IDs as the very last stage which was the right call, it just makes it hard for us to capture these and inject our polyfill because the output has already been determined.
Alternative options?
We could generate the Debug IDs using the same code that the bundlers are using. That way, the debug IDs would match the bundler?
lforst commentedon Apr 28, 2025
I have an idea. We can update our plugins to simply write over the existing debug ID comment with the debug ID that was injected within the snippet right before uploading. We are already injecting a "pattern-matchable" string for exactly this purpose with
e._sentryDebugIdIdentifier="sentry-dbid-${debugId}"timfish commentedon Apr 28, 2025
Yep, good idea!