Title: Compose server source maps and debug IDs across multi-pass builds · Issue #25679 · getsentry/sentry-javascript · GitHub
Open Graph Title: Compose server source maps and debug IDs across multi-pass builds · Issue #25679 · getsentry/sentry-javascript
X Title: Compose server source maps and debug IDs across multi-pass builds · Issue #25679 · getsentry/sentry-javascript
Description: Several frameworks run a second bundling or merging step over the output of the step where Sentry injects debug IDs and generates source maps: Nitro bundles the Vite SSR output again. wrangler and OpenNext bundle the worker. SvelteKit ad...
Open Graph Description: Several frameworks run a second bundling or merging step over the output of the step where Sentry injects debug IDs and generates source maps: Nitro bundles the Vite SSR output again. wrangler and ...
X Description: Several frameworks run a second bundling or merging step over the output of the step where Sentry injects debug IDs and generates source maps: Nitro bundles the Vite SSR output again. wrangler and ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25679
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compose server source maps and debug IDs across multi-pass builds","articleBody":"Several frameworks run a second bundling or merging step over the output of the step where Sentry injects debug IDs and generates source maps:\n\n- Nitro bundles the Vite SSR output again.\n- wrangler and OpenNext bundle the worker.\n- SvelteKit adapters merge files.\n- TanStack Start and Bun builds have similar steps.\n\nWhen the source-map chain is not composed through that later step, or several injected debug IDs end up in one output file, server stack traces resolve to intermediate build files or not at all. Issues: #21012, #20084, #20051, #19213, #19396, #25618.\n\nThere are framework-specific fixes: SvelteKit flattens with `sorcery` (`packages/sveltekit/src/vite/sourceMaps.ts`), #25333 handles Nuxt 5, and #25670 handles Bun. Each framework solves the same problem separately, and the bundler-plugins core has nothing for it.\n\nThere are also two failure modes on the runtime side:\n- When several `_sentryDebugIds` snippets end up in one file, they all map to the same filename and the last one wins.\n- Native `_debugIds` override Sentry's for the same file (`packages/core/src/utils/debug-ids.ts`).\n\nBoth fail silently.\n\n### Proposal\n\n1. **A shared, opt-in \"finalize output\" step in `@sentry/bundler-plugins`,** exposed as a plugin hook and as a CLI command that can run on a final output directory. For each final `.js` file it should:\n - follow the `sourceMappingURL` chain through the intermediate maps and compose it back to the original sources;\n - reduce the file to one debug ID (remove duplicate snippets and stamp a single ID);\n - then upload.\n\n Framework SDKs (SvelteKit, Nuxt/Nitro, TanStack Start, Cloudflare/wrangler, Bun) would enable it inside their existing plugins and replace their own workarounds. This would build on the zero-config source-map work in #25609.\n\n2. **Runtime detection.** Log a debug warning in `getFilenameToDebugIdMap` when more than one debug ID resolves to the same filename, so collisions can be diagnosed.\n\nNot fixable on our side, and worth stating in docs: build steps that emit no source map at all (for example OpenNext, opennextjs-cloudflare#1352), and Turbopack maps that leave mangled names out of `names` (#18248, vercel/next.js#87896).\n","author":{"url":"https://github.com/mydea","@type":"Person","name":"mydea"},"datePublished":"2026-10-23T07:28:55Z","url":"https://github.com/getsentry/sentry-javascript/issues/25679"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1400c29a-d05d-75cb-ca40-023a4afa32c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B52A:1567FF:1EB99:29C94:6B0429DE |
| html-safe-nonce | 8a378e518c24e0d3a95a230c5d222fc661dc3f015315dd95abca4d9a8881f8f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTJBOjE1NjdGRjoxRUI5OToyOUM5NDo2QjA0MjlERSIsInZpc2l0b3JfaWQiOiI1NDU4Njg4NTgzNTY3NDE5ODcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3f600b124ab65ba31fddeaca6280c49f4834658b1bc2471abb3f8ddb45813489 |
| hovercard-subject-tag | issue:5993777912 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25679/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06a3814e9f0ed98c17bcc672b7ceffb5749f1cc2c58883a1f4c804c7a1a22998/getsentry/sentry-javascript/issues/25679 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06a3814e9f0ed98c17bcc672b7ceffb5749f1cc2c58883a1f4c804c7a1a22998/getsentry/sentry-javascript/issues/25679 |
| og:image:alt | Several frameworks run a second bundling or merging step over the output of the step where Sentry injects debug IDs and generates source maps: Nitro bundles the Vite SSR output again. wrangler and ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mydea |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width