Skip to content

fix: stop Sentry double debug IDs breaking client source maps - #1095

Merged
kody-bot merged 1 commit into
mainfrom
cursor/fix-sentry-sourcemaps-debug-ids-9017
Aug 3, 2026
Merged

fix: stop Sentry double debug IDs breaking client source maps#1095
kody-bot merged 1 commit into
mainfrom
cursor/fix-sentry-sourcemaps-debug-ids-9017

Conversation

@kentcdodds

Copy link
Copy Markdown
Member

Summary

Fixes #1094.

Passing sourcemaps through unstable_sentryVitePluginOptions overwrites @sentry/react-router's intentional sourcemaps.disable: true. That re-enables Vite-plugin debug ID injection on top of sentryOnBuildEnd, so every client chunk ships two debug IDs — and the one that wins at runtime has no uploaded map (js_no_source). Upstream: getsentry/sentry-javascript#22929.

Changes

  • Move release (name + setCommits) to the supported top-level SentryReactRouterBuildOptions fields
  • Drop unstable_sentryVitePluginOptions entirely — sentryOnBuildEnd already deletes maps via `${buildDirectory}/**/*.map`
  • Set build.sourcemap: 'hidden' so maps are still emitted for upload without a public sourceMappingURL comment

Test plan

  • Confirm vite.config.ts typechecks with the top-level release shape
  • Production build with SENTRY_AUTH_TOKEN set: each client chunk should contain a single debug ID
  • Confirm uploaded artifacts match that debug ID and client frames symbolicate in Sentry
  • Confirm shipped client assets have no //# sourceMappingURL= comment
Open in Web Open in Cursor 

Passing sourcemaps through unstable_sentryVitePluginOptions overwrites
sourcemaps.disable: true in @sentry/react-router, so each client chunk
gets two debug IDs and Sentry symbolicates against the one without a map.

Move release to the supported top-level options, drop the unstable
sourcemaps override (sentryOnBuildEnd already deletes maps), and use
hidden source maps so public assets do not advertise map URLs.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot marked this pull request as ready for review August 3, 2026 04:04
@kody-bot
kody-bot merged commit f64d690 into main Aug 3, 2026
6 checks passed
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.

Sentry config silently breaks client source maps: sourcemaps in unstable_sentryVitePluginOptions

3 participants