Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(react-router): Inject debug IDs before React Router hashes the client files - #26998

Open
timfish wants to merge 4 commits into
developfrom
fix/react-router-sri
Open

timfish wants to merge 4 commits into
developfrom
fix/react-router-sri

Conversation

@timfish

@timfish timfish commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator
  • With subResourceIntegrity: true, React Router hashes the client files before buildEnd runs. sentryOnBuildEnd then injected debug IDs with the CLI, so the files no longer matched their hashes and browsers blocked them.
  • The Vite plugin now injects the debug IDs during the build. sentryOnBuildEnd still uploads and deletes the maps, and its CLI inject leaves files that already carry a debug ID unchanged, so each chunk still gets one debug ID ([react-router] Any unstable_sentryVitePluginOptions.sourcemaps value re-enables double debug ID injection (regression of #19874) #22929).
  • react-router-8-sourcemaps now turns on subResourceIntegrity and checks every SRI hash against the client files in all three variants. Without the fix, the check fails.
  • Apps that don't call sentryOnBuildEnd now also get debug IDs injected, though nothing uploads their maps.

…ient files

React Router writes the Subresource Integrity hashes of the client files
during the server build, before `buildEnd` runs. `sentryOnBuildEnd`
injected the debug IDs with the CLI after that, so the shipped files no
longer matched their hashes and browsers blocked them.

The Vite plugin now injects the debug IDs during the build. The CLI
inject in `sentryOnBuildEnd` leaves files that already carry a debug ID
unchanged, and `sentryOnBuildEnd` still uploads and deletes the maps.
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: fc09f25 (PR test merge using develop at 19c4139)

Against: 19c4139 (develop) · base run #68368

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.55 kB - -
@sentry/browser - with treeshaking flags 28.74 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.61 kB - -
@sentry/browser (incl. Tracing) 53.69 kB - -
@sentry/browser (incl. Tracing Core) 40.62 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.69 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.58 kB - -
@sentry/browser (incl. Tracing, Replay) 93.61 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.42 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.47 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.42 kB - -
@sentry/browser (incl. Feedback) 48.41 kB - -
@sentry/browser (incl. sendFeedback) 31.12 kB - -
@sentry/browser (incl. FeedbackAsync) 36.18 kB - -
@sentry/browser (incl. Metrics) 31.87 kB - -
@sentry/browser (incl. Logs) 32.15 kB - -
@sentry/browser (incl. Metrics & Logs) 32.81 kB - -
@sentry/react 32.58 kB - -
@sentry/react (incl. Tracing) 56.43 kB - -
@sentry/vue 38.76 kB - -
@sentry/vue (incl. Tracing) 56.7 kB - -
@sentry/svelte 30.58 kB - -
@sentry/effect (client) 42.23 kB - -
@sentry/effect (client, incl. Tracing) 54.97 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.32 kB - -
@sentry/remix (Remix 3 client bundle) 59.43 kB - -
CDN Bundle 32.39 kB - -
CDN Bundle (incl. Tracing) 54.07 kB - -
CDN Bundle (incl. Logs, Metrics) 35.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.53 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.1 kB - -
CDN Bundle (incl. Tracing, Replay) 91.86 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.8 kB - -
CDN Bundle - uncompressed 94.58 kB - -
CDN Bundle (incl. Tracing) - uncompressed 159.89 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.92 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.52 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.32 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.33 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 287.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 299.88 kB - -
@sentry/nextjs (client) 60.24 kB - -
@sentry/sveltekit (client) 55.04 kB - -
@sentry/astro (client) - rolldown, without tracing 39.46 kB -0.01% -1 B 🔽
@sentry/core/server 45.84 kB - -
@sentry/core/browser 14.49 kB - -
@sentry/node 157.92 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.59 kB - -
@sentry/node - without tracing 89.95 kB - -
@sentry/node - without channel injection 146.88 kB - -
@sentry/aws-serverless 100.6 kB - -
@sentry/cloudflare (withSentry) - minified 212.36 kB - -
@sentry/cloudflare (withSentry) 492.5 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 215.31 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.58 kB - -

View base workflow run

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 1 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 3m Details

With `delete: false`, the Vite plugin turned hidden source maps on when
the build had none, for example with only `sourcemaps.upload: false`.
`makeEnableSourceMapsPlugin` leaves the maps off in that case, and
nothing deleted them, so they shipped. `sdkDeleteSourceMaps: false`
keeps the plugin from changing the source map setting at all.
@timfish
timfish marked this pull request as ready for review November 30, 2026 16:53

This branch has not been deployed

No deployments
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.

1 participant