sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Function names remain mangled in Sentry stack traces after upgrading to Next.js 16 + Turbopack

Open rui-reevo opened this issue 2 months ago • 6 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] 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

10.25.0

Framework Version

Next 16.0.3

Link to Sentry event

https://reevo-v7.sentry.io/issues/7041925983/events/1293cbdf13f54015b7cdde21ec9056de/

Reproduction Example/SDK Setup

// instrumentation-client.ts
Sentry.init({
  dsn: '',
  environment: loggerEnv,
  integrations: [
    Sentry.replayIntegration({
      maskAllText: false,
    }),
    Sentry.browserTracingIntegration(),
  ],
  tracesSampleRate: 1,
  replaysSessionSampleRate: 0,
  replaysOnErrorSampleRate: 1.0,
  enabled: true,
});

Steps to Reproduce

  1. Build and deploy — I’ve checked and the sourcemap is definitely being generated and shipped.
  2. Trigger the error and take a look at the stack trace in the Sentry UI.

Expected Result

With sourcemaps, the stack trace will show the real source code and the actual function name.

Actual Result

The code shows up correctly as source, but the function name is still mangled—just like in the raw stack trace.

Additional Context

No response

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.

rui-reevo avatar Nov 19 '25 07:11 rui-reevo

JS-1181

linear[bot] avatar Nov 19 '25 07:11 linear[bot]

Looks like the problem is tied to Turbopack — switching back to Webpack makes it go away. Any ideas on how to work around this?

rui-reevo avatar Nov 19 '25 09:11 rui-reevo

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: Image

vs Webpack:

Image

JPeer264 avatar Nov 19 '25 09:11 JPeer264

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 👍

chargome avatar Nov 19 '25 10:11 chargome

any updates on this? ty

rui-reevo avatar Dec 09 '25 04:12 rui-reevo

Unfortunately not yet. We'll give an update here next week, sorry for the delays

JPeer264 avatar Dec 09 '25 09:12 JPeer264