Skip to content

fix(nextjs): Correct in_app for Turbopack dev server stack frames - #23248

Merged
logaretm merged 1 commit into
developfrom
awad/turbopack-dev-server-in-app
Aug 11, 2026
Merged

fix(nextjs): Correct in_app for Turbopack dev server stack frames#23248
logaretm merged 1 commit into
developfrom
awad/turbopack-dev-server-in-app

Conversation

@logaretm

@logaretm logaretm commented Aug 11, 2026

Copy link
Copy Markdown
Member

Under next dev with Turbopack, server-side stack frames get their in_app classification inverted: vendor code from node_modules shows as in-app while the actual app crash frame shows as non-app.

Turbopack's dev chunk naming flattens node_modules/ to underscores (node_modules_ai_<hash>.js) and prefixes app modules with [project]/, both of which defeat filenameIsInApp.

closes #23176

Turbopack's dev chunk names (node_modules_<pkg>_<hash>.js, [project]/...)
defeat filenameIsInApp, so vendor frames are marked in_app and the real app
crash frame is not. The dev symbolication processor already resolves frames
back to their original source paths but preserved the wrong in_app via the
...frame spread. Re-derive in_app from the resolved path instead.
@logaretm
logaretm marked this pull request as ready for review August 11, 2026 05:21
@logaretm
logaretm requested a review from a team as a code owner August 11, 2026 05:21
@logaretm
logaretm requested review from chargome, mydea and s1gr1d and removed request for a team August 11, 2026 05:21
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.35 kB - -
@sentry/browser - with treeshaking flags 28.52 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.85 kB - -
@sentry/browser (incl. Tracing) 48.61 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.62 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.46 kB - -
@sentry/browser (incl. Tracing, Replay) 88.04 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.77 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.45 kB - -
@sentry/browser (incl. Feedback) 47.69 kB - -
@sentry/browser (incl. sendFeedback) 35.18 kB - -
@sentry/browser (incl. FeedbackAsync) 40.33 kB - -
@sentry/browser (incl. Metrics) 31.43 kB - -
@sentry/browser (incl. Logs) 31.66 kB - -
@sentry/browser (incl. Metrics & Logs) 32.34 kB - -
@sentry/react 32.14 kB - -
@sentry/react (incl. Tracing) 50.82 kB - -
@sentry/vue 35.45 kB - -
@sentry/vue (incl. Tracing) 50.59 kB - -
@sentry/svelte 30.38 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.92 kB - -
CDN Bundle (incl. Logs, Metrics) 33.84 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.88 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.38 kB - -
CDN Bundle (incl. Tracing, Replay) 86.49 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.18 kB - -
CDN Bundle - uncompressed 93.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.92 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.78 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.34 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.17 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.7 kB - -
@sentry/nextjs (client) 53.38 kB - -
@sentry/sveltekit (client) 49.03 kB - -
@sentry/core/server 65.65 kB - -
@sentry/core/browser 51.98 kB - -
@sentry/node 118.46 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.57 kB -0.01% -2 B 🔽
@sentry/aws-serverless 91.94 kB - -
@sentry/cloudflare (withSentry) - minified 214.7 kB - -
@sentry/cloudflare (withSentry) 530.37 kB - -

View base workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e0d8aed. Configure here.

const vendorFrames = frames.filter(frame => frame.filename?.includes('node_modules'));
for (const vendorFrame of vendorFrames) {
expect(vendorFrame.in_app, `vendor frame ${vendorFrame.filename} should not be in_app`).toBe(false);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vacuous vendor in_app assertion

Low Severity

The vendor in_app checks can pass without verifying any frames: vendorFrames is filtered and asserted in a loop, but nothing requires that filter to match. That weakens coverage for the half of this regression where vendor frames were wrongly marked in_app. Sibling tests in this app assert filtered collections are non-empty before checking their contents. Flagged because the PR review rules ask for thorough assertions of newly added behavior in fix tests.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit e0d8aed. Configure here.

filename: resolvedFilename,
// The parse-time `in_app` is derived from Turbopack's dev chunk names (`node_modules_<pkg>_<hash>.js`,
// `[project]/…`), which invert the classification. Re-derive it from the resolved original source path.
in_app: resolvedFilename ? !resolvedFilename.includes('node_modules') : frame.in_app,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the filenames always starting with this string? Then we could tighten this to .startsWith('node_modules_') 🤔

@logaretm logaretm Aug 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to make that assumption since it may rely on the project being in a workspace or something so the starting path wouldn't be node_modules_[...]

Also noticed that npm and yarn would yield absolute paths (/Users/...node_modules) at least from one test I tried. The downside is if someone does have a file called node_modules then it would be incorrectly tagged but I wonder how common is that.

@chargome chargome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still overwritten in symbolication though according to the ticket

@logaretm
logaretm merged commit d671759 into develop Aug 11, 2026
81 checks passed
@logaretm
logaretm deleted the awad/turbopack-dev-server-in-app branch August 11, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turbopack dev: server stack frames get inverted in_app, and SDK-side fixes are overridden at ingest

3 participants