From fe3c0ba93f9a8fb6ec3857e84ce1e30cbf6cac99 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 19 Mar 2026 10:46:50 -0700 Subject: [PATCH] fix(react-router): Disable debug ID injection in Vite plugin to prevent double injection Set sourcemaps.disable to true (boolean) instead of 'disable-upload' (string) in makeCustomSentryVitePlugins. The Rollup plugin checks disable !== true, so the string value was not disabling debug ID injection. This caused double injection with two different UUIDs per file when sentryOnBuildEnd also ran sentry-cli sourcemaps inject, breaking source map resolution. Fixes GH-19874 Co-Authored-By: Claude --- packages/react-router/src/vite/makeCustomSentryVitePlugins.ts | 2 +- .../test/vite/makeCustomSentryVitePlugins.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts b/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts index 1863a7b66f9f..fcec109c6baa 100644 --- a/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts +++ b/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts @@ -42,7 +42,7 @@ export async function makeCustomSentryVitePlugins(options: SentryReactRouterBuil }, // will be handled in buildEnd hook sourcemaps: { - disable: 'disable-upload', + disable: true, ...unstable_sentryVitePluginOptions?.sourcemaps, }, ...unstable_sentryVitePluginOptions, diff --git a/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts b/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts index 98dc6d8ba662..b98a6ebfb80d 100644 --- a/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts +++ b/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts @@ -54,13 +54,13 @@ describe('makeCustomSentryVitePlugins', () => { expect(plugins?.[0]?.name).toBe('sentry-vite-plugin'); }); - it('should disable sourcemap upload with "disable-upload" by default', async () => { + it('should disable sourcemap upload by default', async () => { await makeCustomSentryVitePlugins({}); expect(sentryVitePlugin).toHaveBeenCalledWith( expect.objectContaining({ sourcemaps: expect.objectContaining({ - disable: 'disable-upload', + disable: true, }), }), );