Skip to content

Commit 28f94f3

Browse files
isaacsclaude
andcommitted
fix(react-router): Disable debug ID injection in Vite plugin to prevent double injection (##19890)
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 <noreply@anthropic.com>
1 parent 9bfc682 commit 28f94f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-router/src/vite/makeCustomSentryVitePlugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function makeCustomSentryVitePlugins(options: SentryReactRouterBuil
4242
},
4343
// will be handled in buildEnd hook
4444
sourcemaps: {
45-
disable: 'disable-upload',
45+
disable: true,
4646
...unstable_sentryVitePluginOptions?.sourcemaps,
4747
},
4848
...unstable_sentryVitePluginOptions,

packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ describe('makeCustomSentryVitePlugins', () => {
5454
expect(plugins?.[0]?.name).toBe('sentry-vite-plugin');
5555
});
5656

57-
it('should disable sourcemap upload with "disable-upload" by default', async () => {
57+
it('should disable sourcemap upload by default', async () => {
5858
await makeCustomSentryVitePlugins({});
5959

6060
expect(sentryVitePlugin).toHaveBeenCalledWith(
6161
expect.objectContaining({
6262
sourcemaps: expect.objectContaining({
63-
disable: 'disable-upload',
63+
disable: true,
6464
}),
6565
}),
6666
);

0 commit comments

Comments
 (0)