Skip to content

fix(v10/react-router): Preserve sourcemaps.disable when unstable_sentryVitePluginOptions is set - #22966

Merged
chargome merged 2 commits into
v10from
cg/backport-v10-rr-sourcemaps-disable
Aug 3, 2026
Merged

fix(v10/react-router): Preserve sourcemaps.disable when unstable_sentryVitePluginOptions is set#22966
chargome merged 2 commits into
v10from
cg/backport-v10-rr-sourcemaps-disable

Conversation

@chargome

@chargome chargome commented Aug 3, 2026

Copy link
Copy Markdown
Member

Backport of: #22945

Also flips sourcemaps.disable precedence in sentryOnBuildEnd so
unstable_sentryVitePluginOptions wins. This is not part of #22945 as the unstable options will likely disappear there anyway.

@chargome chargome self-assigned this Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.75 kB added added
@sentry/browser - with treeshaking flags 26.19 kB added added
@sentry/browser (incl. Tracing) 46.6 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.38 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.34 kB added added
@sentry/browser (incl. Tracing, Replay) 85.84 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.48 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.55 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.2 kB added added
@sentry/browser (incl. Feedback) 44.92 kB added added
@sentry/browser (incl. sendFeedback) 32.55 kB added added
@sentry/browser (incl. FeedbackAsync) 37.68 kB added added
@sentry/browser (incl. Metrics) 28.84 kB added added
@sentry/browser (incl. Logs) 29.07 kB added added
@sentry/browser (incl. Metrics & Logs) 29.76 kB added added
@sentry/react 29.55 kB added added
@sentry/react (incl. Tracing) 48.86 kB added added
@sentry/vue 33.17 kB added added
@sentry/vue (incl. Tracing) 48.56 kB added added
@sentry/svelte 27.78 kB added added
CDN Bundle 30.14 kB added added
CDN Bundle (incl. Tracing) 48.56 kB added added
CDN Bundle (incl. Logs, Metrics) 31.73 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.86 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 70.99 kB added added
CDN Bundle (incl. Tracing, Replay) 86.05 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.36 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.86 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.12 kB added added
CDN Bundle - uncompressed 89.9 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.78 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.61 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.75 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.37 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.01 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.98 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.71 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.67 kB added added
@sentry/nextjs (client) 51.4 kB added added
@sentry/sveltekit (client) 47.02 kB added added
@sentry/core/server 80.44 kB added added
@sentry/core/browser 66.78 kB added added
@sentry/node-core 63.25 kB added added
@sentry/node 125.89 kB added added
@sentry/node (incl. diagnostics channel injection) 151.33 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB added added
@sentry/node/light 51.41 kB added added
@sentry/node - without tracing 74.94 kB added added
@sentry/aws-serverless 84.21 kB added added
@sentry/cloudflare (withSentry) - minified 200.5 kB added added
@sentry/cloudflare (withSentry) 492.68 kB added added

…ourcemaps.disable

`unstable_sentryVitePluginOptions` is documented as being able to override any option the
SDK passes to the bundler plugin, and nuxt, sveltekit and nextjs all implement it that way.
`sentryOnBuildEnd` was the one place that resolved `sourcemaps.disable` the other way
round, giving the top-level option precedence.

Note this only affects the buildEnd hook, where two user-supplied values genuinely conflict.
The Vite plugin still pins `disable: true` unconditionally - that is an architectural
invariant rather than a precedence decision, since the plugin injecting debug IDs on top of
this hook is what breaks source map resolution.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome
chargome marked this pull request as ready for review August 3, 2026 15:51
@chargome
chargome requested a review from a team as a code owner August 3, 2026 15:51
@chargome
chargome requested review from Lms24, nicohrubec and s1gr1d and removed request for a team August 3, 2026 15:51
Comment thread packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts
@chargome
chargome merged commit e00b1ae into v10 Aug 3, 2026
49 checks passed
@chargome
chargome deleted the cg/backport-v10-rr-sourcemaps-disable branch August 3, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants