Repository navigation
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
11.19.0
Framework Version
Next 16.4.6, React 19.3.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
export default withSentryConfig(nextConfig, {
sourcemaps: { disable: true },
reactComponentAnnotation: { enabled: process.env.ANNOTATE === '1' },
});nextConfig sets only productionBrowserSourceMaps: true, so the maps can be read locally.
Steps to Reproduce
- Clone the repo and run
npm install. - Run
npm run repro. It builds with webpack and with Turbopack, each withreactComponentAnnotationoff and on. - After each build,
check-names.mjsprints thenameon the source-map mapping of each function declared inapp/login-button.tsx.
Expected Result
The mapping on each minified function binding keeps the original name, as it does with the option off. Sentry then shows handleLogin in stack frames.
Actual Result
With the option on, the mappings have no name, with both bundlers:
== next build --webpack, reactComponentAnnotation off
LoginButton minified as o, mapping name: LoginButton
handleClick minified as o, mapping name: handleClick
handleLogin minified as n, mapping name: handleLogin
== next build --webpack, reactComponentAnnotation on
LoginButton no mapping at the declaration
handleClick no mapping at the declaration
handleLogin minified as n, mapping name: null
== next build --turbopack, reactComponentAnnotation off
LoginButton no mapping at the declaration
handleClick minified as n, mapping name: handleClick
handleLogin minified as a, mapping name: handleLogin
== next build --turbopack, reactComponentAnnotation on
LoginButton no mapping at the declaration
handleClick minified as a, mapping name: null
handleLogin minified as i, mapping name: null
So stack frames from annotated files show minified function names (n, a, i), even though the files, lines and source context resolve. The minified names change from build to build. Grouping uses function names, so one error can split into a new issue on each release.
On a real app, our client chunk maps had 750 named and 776 unnamed function bindings with the option on, against 807 named and 590 unnamed with it off (Turbopack).
Additional Context
node transform.mjs in the repo calls createComponentNameAnnotateHooks from @sentry/bundler-plugins/loader-utils directly:
annotated: true
map.names: []
The transform edits the code with magic-string and returns magicString.generateMap({ hires: true }). That map has no names. I think the names are lost when the bundler composes this map with the later SWC and minifier maps, but I have not confirmed which step drops them.
The workaround is reactComponentAnnotation: { enabled: false }, at the cost of component names in breadcrumbs, Replay and spans.
Turbopack also drops some names on its own (vercel/next.js#102474), but only in modules that import another local module. The repro component has no local imports, so that bug does not apply here.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status
Activity
linear-code commentedon Nov 27, 2026
JS-4169
chargome commentedon Nov 27, 2026
Thanks for reporting @MorrisonCole !