Skip to content

fix(bundler-plugins): Preserve full file path in component annotation source maps - #23572

Merged
nicohrubec merged 1 commit into
developfrom
fix/component-annotation-source-map-paths
Aug 25, 2026
Merged

fix(bundler-plugins): Preserve full file path in component annotation source maps#23572
nicohrubec merged 1 commit into
developfrom
fix/component-annotation-source-map-paths

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Aug 25, 2026

Copy link
Copy Markdown
Member

With reactComponentAnnotation enabled, the Babel transform emitted source maps without sourceFileName, so Babel defaulted each map's sources to the bare basename and every annotated .jsx/.tsx file lost its directory in the final .js.map. Passing sourceFileName alongside filename restores the full path, matching how non-annotated files and the vite annotation path already behave.

Fixes #23561

… source maps

The component annotation Babel transform emitted source maps without
`sourceFileName`, so Babel defaulted each map's `sources` to the bare
basename, dropping the directory for every annotated .jsx/.tsx file.
Pass `sourceFileName` alongside `filename` to keep the full path.

Fixes #23561

Co-Authored-By: Ryan Rho <272582209+ryanrho-mercor@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.5 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.52 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.43 kB - -
@sentry/browser (incl. Tracing, Replay) 87.89 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.35 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.59 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.3 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.71 kB - -
@sentry/vue 35.64 kB - -
@sentry/vue (incl. Tracing) 50.73 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 49.02 kB - -
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.91 kB - -
CDN Bundle (incl. Tracing, Replay) 86.47 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.17 kB - -
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.64 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.33 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.92 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.6 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.62 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.28 kB - -
@sentry/nextjs (client) 53.23 kB - -
@sentry/sveltekit (client) 48.92 kB - -
@sentry/core/server 65.11 kB - -
@sentry/core/browser 52.27 kB - -
@sentry/node 117.66 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.2 kB +0.03% +24 B 🔺
@sentry/aws-serverless 91.64 kB +0.03% +21 B 🔺
@sentry/cloudflare (withSentry) - minified 196.9 kB - -
@sentry/cloudflare (withSentry) 487.47 kB - -

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review August 25, 2026 12:26
@nicohrubec
nicohrubec requested review from Lms24, isaacs and timfish August 25, 2026 12:26
Comment thread packages/bundler-plugins/test/core/index.test.ts

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nicohrubec
nicohrubec merged commit 4bbb2ed into develop Aug 25, 2026
187 checks passed
@nicohrubec
nicohrubec deleted the fix/component-annotation-source-map-paths branch August 25, 2026 15:07
nicohrubec added a commit that referenced this pull request Aug 26, 2026
nicohrubec added a commit that referenced this pull request Aug 26, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution.

@ryanrho-mercor reported the source-map path regression and suggested
the exact fix in #23561. The fix shipped on v10 via the backport #23595
(original: #23572), so they should be credited in the next v10 release.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

reactComponentAnnotation drops the directory from source-map sources (missing sourceFileName)

2 participants