You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reactComponentAnnotation drops the directory from source-map sources (missing sourceFileName) #23561
.ts modules are unaffected, since the transform skips them — which is what makes the pattern easy to spot: in one production build, 383 of 400 .tsx sources were bare filenames while 1,052 .ts sources kept full paths. Disabling reactComponentAnnotation gives 973 .tsx sources with correct paths and 0 bare ones, confirming the transform is the cause.
Cause
createComponentNameAnnotateHooks (packages/bundler-plugins, build/{esm,cjs}/core/index.js in the published package) calls Babel without sourceFileName:
When sourceFileName is omitted, Babel defaults the emitted map's sources to path.basename(filename). The loader hands that map to the bundler, which propagates the basename into the final .js.map.
Suggested fix
Pass sourceFileName alongside filename, using the query/hash-stripped id the function already computes:
Verified locally as a patch: .tsx sources with real paths went 17 → 973, bare filenames 383 → 0, no absolute paths leaked into the maps, and data-sentry-component attributes were still emitted in the same number of chunks. Happy to open a PR if useful.
Note the same call exists in @sentry/bundler-plugin-core (used by the Turbopack loader path), so it likely needs the same change.
Impact
Any tool that maps browser source maps back to repository files loses those files. We hit it with a coverage tool that could not attribute ~580 files and reported the result as an underestimate; the same path loss would affect anything else resolving frames to source paths.
Expected result
Annotated .jsx/.tsx modules keep the same source paths in the emitted source maps as they have with reactComponentAnnotation disabled.
Hey, this is now fixed and will go out with the next v10 release. I added you as co-author on the PR and we'll mention you in the changelog, thank you for your contribution!
Activity
linear-code commentedon Aug 25, 2026
JS-3424
nicohrubec commentedon Aug 25, 2026
Hey, thanks for writing in. We'll take a look.
fix(bundler-plugins): Preserve full file path in component annotation…
nicohrubec commentedon Aug 26, 2026
Hey, this is now fixed and will go out with the next v10 release. I added you as co-author on the PR and we'll mention you in the changelog, thank you for your contribution!
chore(v10): Add external contributor to CHANGELOG.md (#23626)
perf(bundler-plugins): Use fast component annotation for Webpack and …