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
@sentry/nextjs 10.69.0, Next.js 16.3.0, next dev (Turbopack), Node server runtime
What happens
When app code throws under next dev (Turbopack), the stored event has in_app backwards: frames from third-party packages show as In App, while the app's own crash frame shows as non-app. The issue page leads with vendor frames and says "Crashed in non-app: lib/…".
in_app: true | app:///_next/dev/server/chunks/node_modules_ai_dist_index_16zsbns.js (× 9)
in_app: false | lib/ai/tools.ts ← the actual crash site
Why
Turbopack's dev chunk naming defeats the SDK's classification:
filenameIsInApp (packages/core/src/utils/node-stack-trace.ts) marks a frame as vendor only if its filename contains node_modules/. Turbopack flattens that to underscores (node_modules_@ai-sdk_…_<hash>.js), so vendor frames count as app code.
The same function treats filenames that don't start with /, a drive letter, ., or a protocol as internal. Turbopack app modules are bracket-prefixed ([project]/…), so app frames count as non-app.
devErrorSymbolicationEventProcessor.ts resolves the app frame back to its real file but keeps the wrong in_app (the ...frame spread); frames it can't resolve get in_app: false.
Note for a fix: correcting the classification isn't enough on its own. Sentry's ingest re-derives in_app from frame paths and overwrites whatever the event says (confirmed: a beforeSend that forced correct values ran, yet the stored event was inverted again). The fix needs to change the paths the SDK emits — e.g. restore a real /node_modules/ segment — or ingest's rules need to learn Turbopack's naming.
Reproduce
Throw any error in app code under next dev (Turbopack, Next 16) and check stacktrace.frames[].in_app on the stored event. Ready-made repro: https://github.com/getsentry/sentry-agent-tracing-examples (storefront-commerce has an intentionally failing tool in lib/ai/tools.ts).
Production builds are fine: with source maps uploaded, classification is correct; without them, everything is one minified chunk marked in-app.
Environment
@sentry/nextjs10.69.0, Next.js 16.3.0,next dev(Turbopack), Node server runtimeWhat happens
When app code throws under
next dev(Turbopack), the stored event hasin_appbackwards: frames from third-party packages show as In App, while the app's own crash frame shows as non-app. The issue page leads with vendor frames and says "Crashed in non-app: lib/…".Why
Turbopack's dev chunk naming defeats the SDK's classification:
filenameIsInApp(packages/core/src/utils/node-stack-trace.ts) marks a frame as vendor only if its filename containsnode_modules/. Turbopack flattens that to underscores (node_modules_@ai-sdk_…_<hash>.js), so vendor frames count as app code./, a drive letter,., or a protocol as internal. Turbopack app modules are bracket-prefixed ([project]/…), so app frames count as non-app.devErrorSymbolicationEventProcessor.tsresolves the app frame back to its real file but keeps the wrongin_app(the...framespread); frames it can't resolve getin_app: false.in_app#22354 (10.67.0) fixed the same problem for client-side_next/static/chunksonly.Note for a fix: correcting the classification isn't enough on its own. Sentry's ingest re-derives
in_appfrom frame paths and overwrites whatever the event says (confirmed: abeforeSendthat forced correct values ran, yet the stored event was inverted again). The fix needs to change the paths the SDK emits — e.g. restore a real/node_modules/segment — or ingest's rules need to learn Turbopack's naming.Reproduce
Throw any error in app code under
next dev(Turbopack, Next 16) and checkstacktrace.frames[].in_appon the stored event. Ready-made repro: https://github.com/getsentry/sentry-agent-tracing-examples (storefront-commercehas an intentionally failing tool inlib/ai/tools.ts).Production builds are fine: with source maps uploaded, classification is correct; without them, everything is one minified chunk marked in-app.
Workaround
Project → Settings → Issue Grouping → Stack Trace Rules: