Title: sentryReactRouter double-injects debug IDs, breaking source map resolution (same as #15106) · Issue #19874 · getsentry/sentry-javascript · GitHub
Open Graph Title: sentryReactRouter double-injects debug IDs, breaking source map resolution (same as #15106) · Issue #19874 · getsentry/sentry-javascript
X Title: sentryReactRouter double-injects debug IDs, breaking source map resolution (same as #15106) · Issue #19874 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/19874
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sentryReactRouter double-injects debug IDs, breaking source map resolution (same as #15106)","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/react-router\n\n### SDK Version\n\n10.44.0\n\n### Framework Version\n\nReact Router 7.13.0\n\n### Link to Sentry event\n\nhttps://stagtech.sentry.io/issues/101940091/?project=4510804972798032&query=release%3A326b772c6b3e5039a956e96e67346ee387124681\n\n### Reproduction Example/SDK Setup\n\n## Minimal reproduction\n\n```bash\nnpx create-react-router@latest sentry-repro --yes\ncd sentry-repro\nnpm install @sentry/react-router @sentry/cli\n```\n\n**vite.config.ts** (per [official docs](https://docs.sentry.io/platforms/javascript/guides/react-router/manual-setup/)):\n```typescript\nimport { reactRouter } from \"@react-router/dev/vite\";\nimport { sentryReactRouter, type SentryReactRouterBuildOptions } from \"@sentry/react-router\";\nimport { defineConfig } from \"vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\n\nconst sentryConfig: SentryReactRouterBuildOptions = {\n org: \"test-org\",\n project: \"test-project\",\n authToken: process.env.SENTRY_AUTH_TOKEN,\n};\n\nexport default defineConfig((config) => ({\n build: { sourcemap: \"hidden\" },\n plugins: [reactRouter(), sentryReactRouter(sentryConfig, config), tsconfigPaths()],\n}));\n```\n\n**react-router.config.ts**:\n```typescript\nimport type { Config } from \"@react-router/dev/config\";\nimport { sentryOnBuildEnd } from \"@sentry/react-router\";\n\nexport default {\n ssr: true,\n buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {\n await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest });\n },\n} satisfies Config;\n```\n\nBuild and check:\n```bash\nSENTRY_AUTH_TOKEN=fake npx react-router build 2>&1 # errors on upload are expected (fake token)\ngrep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' build/client/assets/entry.client-*.js | sort | uniq -c\n```\n\nResult: **two different UUIDs** in a single file — one from the Vite plugin's `renderChunk`, one from `sentry-cli sourcemaps inject` called by `sentryOnBuildEnd`.\n\n## Root cause\n\n`makeCustomSentryVitePlugins.js` sets `sourcemaps: { disable: 'disable-upload' }`, which disables the upload but not debug ID injection. The Rollup plugin checks `options.sourcemaps?.disable !== true`, and `'disable-upload' !== true` → injection still happens.\n\nThen `sentryOnBuildEnd` calls `sentry-cli sourcemaps inject` which doesn't find a `//# debugId=` comment (because `writeBundle` was also skipped), so it injects a second snippet with a different UUID.\n\nAt runtime, the Vite plugin's snippet overwrites sentry-cli's in the `_sentryDebugIds` map. The SDK sends the Vite plugin's UUID, but the upload has sentry-cli's UUID → mismatch → `js_no_source`.\n\n## Suggested fix\n\nSame approach as #15109 for Next.js. In `makeCustomSentryVitePlugins.js`:\n\n```diff\n sourcemaps: {\n- disable: 'disable-upload',\n+ disable: true,\n ...unstable_sentryVitePluginOptions?.sourcemaps,\n },\n```\n\n## Workaround\n\n```typescript\nconst sentryConfig: SentryReactRouterBuildOptions = {\n // ...\n unstable_sentryVitePluginOptions: {\n sourcemaps: { disable: true },\n },\n};\n```\n\n\n### Steps to Reproduce\n\n 1. npx create-react-router@latest sentry-repro --yes\n 2. Add sentryReactRouter + sentryOnBuildEnd per the official docs (see above)\n 3. SENTRY_AUTH_TOKEN=fake npx react-router build\n 4. grep -oE '[0-9a-f]{8}-...-[0-9a-f]{12}' build/client/assets/entry.client-*.js | sort | uniq -c\n 5. Observe two different UUIDs in the same file\n\n### Expected Result\n\nEach output file should contain exactly one debug ID, matching the uploaded source map artifact. Source maps should resolve correctly.\n\n### Actual Result\n\nTwo different UUIDs per file — one from the Vite plugin (renderChunk), one from sentry-cli (sentryOnBuildEnd). The SDK sends the wrong one, source maps never resolve.\n\n### Additional Context\n\nThis is the same bug as #15106, which was fixed for Next.js/webpack in #15109 by changing `sourcemaps.disable` from a workaround value to `true`. The React Router/Vite integration needs the same one-line fix in `makeCustomSentryVitePlugins.js`.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/dominik-stagtech","@type":"Person","name":"dominik-stagtech"},"datePublished":"2026-03-19T12:03:23Z","url":"https://github.com/getsentry/sentry-javascript/issues/19874"}
| 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:35ad2f3a-e096-bbf6-39ad-74cfb9d6478a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A672:21614F:E73654:1463318:6B0447A1 |
| html-safe-nonce | 7afb358b9fdb98a48a36d3c68186092d314dd4bca03cbb66f2bc5c40a50a3fd9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjcyOjIxNjE0RjpFNzM2NTQ6MTQ2MzMxODo2QjA0NDdBMSIsInZpc2l0b3JfaWQiOiIxNjc3OTc5OTY1NTUzMTMzNDczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e5fad4c1a6500ba5c260a3bfa7231da8636c1733bdeeedc62e2cdfeb8709b579 |
| hovercard-subject-tag | issue:4101237711 |
| 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/19874/issue_layout |
| twitter:image | https://opengraph.githubassets.com/183e6f43d2f059fc36c6065399fb819b92cfb17016453ab84de07030fb1a522c/getsentry/sentry-javascript/issues/19874 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/183e6f43d2f059fc36c6065399fb819b92cfb17016453ab84de07030fb1a522c/getsentry/sentry-javascript/issues/19874 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dominik-stagtech |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| 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