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
Function names remain mangled in Sentry stack traces after upgrading to Next.js 16 + Turbopack #18248
Hey @rui-reevo I just confirmed this with Turbopack (yes, with Webpack it does work). The fastest workaround is to use Webpack for now, or rely on Turbopack in the combination of the line of code.
Hey @chargome, just wanted to check in — we're still hitting this issue on Next.js 16.2.3 with _experimental.turbopackReactComponentAnnotation.enabled set for Turbopack. Any updates on where things stand? It's been pretty painful on our end.
Same symptom on the server side, with a measurement of where the name is lost. It doesn't look
like an SDK defect: the maps Sentry receives carry no names entry for the mangled bindings.
Setup
Next.js 16.3.3 (Turbopack, the default bundler), @sentry/nextjs 10.73.0, Node 24, on Vercel
Server source maps upload and match. Every first-party frame resolves the right file, line and
source-context line; only the function names are wrong.
What the frames look like (symbol and path names generalized):
Frame as Sentry shows it
Resolves to
Context line
W
app/api/.../route.ts:228
await deprovisionThing(...)
H
lib/.../deprovision-thing.ts:172
capture('remove', ...)
$
lib/.../deprovision-thing.ts:168
captureStageFailure(...)
<anonymous>
lib/.../capture-stage-failure.ts:27
Sentry.captureException(...)
Where the name is lost
next build with SENTRY_AUTH_TOKEN unset, then inspect the emitted chunk map. Turbopack writes sectioned maps, so the check has to flatten first:
// node, from the repo root, after `next build`constfs=require('fs')const{ FlattenMap, originalPositionFor }=require('@jridgewell/trace-mapping')// find the chunk with: grep -rl '<a string literal from the function>' .next/server/chunksconstmap=newFlattenMap(JSON.parse(fs.readFileSync(chunk+'.map','utf8')))originalPositionFor(map,{ line, column /* of the mangled identifier */})// → { source, line, column, name: null } ← the defect
export async function deprovisionThing(…) is emitted as async function z(e){…}. The mapping
at token z points exactly at the original identifier in the source, and carries name: null.
const capture = (…) => … is emitted as U=(e,a,r)=>…; mapping correct, name: null again.
That chunk map's names table holds 244 entries and contains none of the mangled bindings'
original names. The entries it does hold are property keys and unmangled identifiers.
Exported functions are additionally emitted as anonymous function expressions inside the
module's export call, e.s(["captureStageFailure",0,function(e){…}]), so V8 itself reports <anonymous>; there is no name token there for any consumer to map.
So symbolication has nothing to recover from. Per Sentry's own description of the scope-based
approach (https://blog.sentry.io/how-we-made-javascript-stack-traces-awesome — "For each of these
individual components, we do a lookup in the provided source map. And if the source map is
properly constructed, we will get a name back"), the lookup at the minified identifier returns null, so the minified name stands. Re-uploading or widening the upload globs changes nothing —
matching already works.
Things that don't work around it on 16.3.x
experimental.serverMinification: false — accepted by the config schema, and Turbopack's
unsupported-options list doesn't reject it, but it's a no-op: the rebuilt server output was
byte-identical (same chunk hashes, same total byte count), and the key is absent from next-swc.<platform>.node. Only the webpack build honours it.
experimental.turbopackMinify: false — works, but it's global, so it un-minifies the client
bundles too.
The underlying gap looks like Turbopack's minifier: it mangles bindings without recording the
original names in the map's names table, so there's nothing for scope-based name recovery to
look up. Next.js canary has widened experimental.turbopackMinify to a per-environment form
({ server, client, edge }), which lets a server build skip minification, but that sidesteps the
defect rather than fixing it, and client bundles would still lose their names.
Activity
linear commentedon Nov 19, 2025
JS-1181
rui-reevo commentedon Nov 19, 2025
Looks like the problem is tied to Turbopack — switching back to Webpack makes it go away. Any ideas on how to work around this?
JPeer264 commentedon Nov 19, 2025
Hey @rui-reevo I just confirmed this with Turbopack (yes, with Webpack it does work). The fastest workaround is to use Webpack for now, or rely on Turbopack in the combination of the line of code.
I'll leave this picture here for the record:
Turbopack:

vs Webpack:
chargome commentedon Nov 19, 2025
Hey @rui-reevo we're aware of this, this will require a change in our symbolication pipeline. I'll leave this issue open for now 👍
rui-reevo commentedon Dec 9, 2025
any updates on this? ty
29 remaining items
rui-reevo commentedon May 11, 2026
Hey @chargome, just wanted to check in — we're still hitting this issue on Next.js 16.2.3 with
_experimental.turbopackReactComponentAnnotation.enabledset for Turbopack. Any updates on where things stand? It's been pretty painful on our end.chargome commentedon May 11, 2026
Hey @rui-reevo I think we're still waiting on Vercel for an upstream fix here. I'll check again and ping them
digitalcostas commentedon Sep 16, 2026
Same symptom on the server side, with a measurement of where the name is lost. It doesn't look
like an SDK defect: the maps Sentry receives carry no
namesentry for the mangled bindings.Setup
@sentry/nextjs10.73.0, Node 24, on Vercelsource-context line; only the function names are wrong.
What the frames look like (symbol and path names generalized):
Wapp/api/.../route.ts:228await deprovisionThing(...)Hlib/.../deprovision-thing.ts:172capture('remove', ...)$lib/.../deprovision-thing.ts:168captureStageFailure(...)<anonymous>lib/.../capture-stage-failure.ts:27Sentry.captureException(...)Where the name is lost
next buildwithSENTRY_AUTH_TOKENunset, then inspect the emitted chunk map. Turbopack writessectioned maps, so the check has to flatten first:
export async function deprovisionThing(…)is emitted asasync function z(e){…}. The mappingat token
zpoints exactly at the original identifier in the source, and carriesname: null.const capture = (…) => …is emitted asU=(e,a,r)=>…; mapping correct,name: nullagain.namestable holds 244 entries and contains none of the mangled bindings'original names. The entries it does hold are property keys and unmangled identifiers.
module's export call,
e.s(["captureStageFailure",0,function(e){…}]), so V8 itself reports<anonymous>; there is no name token there for any consumer to map.So symbolication has nothing to recover from. Per Sentry's own description of the scope-based
approach (https://blog.sentry.io/how-we-made-javascript-stack-traces-awesome — "For each of these
individual components, we do a lookup in the provided source map. And if the source map is
properly constructed, we will get a
nameback"), the lookup at the minified identifier returnsnull, so the minified name stands. Re-uploading or widening the upload globs changes nothing —matching already works.
Things that don't work around it on 16.3.x
experimental.serverMinification: false— accepted by the config schema, and Turbopack'sunsupported-options list doesn't reject it, but it's a no-op: the rebuilt server output was
byte-identical (same chunk hashes, same total byte count), and the key is absent from
next-swc.<platform>.node. Only the webpack build honours it.experimental.turbopackMinify: false— works, but it's global, so it un-minifies the clientbundles too.
The underlying gap looks like Turbopack's minifier: it mangles bindings without recording the
original names in the map's
namestable, so there's nothing for scope-based name recovery tolook up. Next.js canary has widened
experimental.turbopackMinifyto a per-environment form(
{ server, client, edge }), which lets a server build skip minification, but that sidesteps thedefect rather than fixing it, and client bundles would still lose their names.
chargome commentedon Sep 18, 2026
@digitalcostas yeah this has been established already in vercel/next.js#87896
We'll get back on it with the vercel team