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
nextjs: Turbopack applicationKey metadata adds 93.6 kB gzip to the browser bundle; opt-out for node_modules? #25754
Set applicationKey on a Next 16 app building with Turbopack.
next build with it and without it.
Compare First Load JS per route, and count _sentryModuleMetadata[...stack]=Object.assign in .next/static.
Expected Result
A supported way to keep thirdPartyErrorFilterIntegration without tagging every bundled dependency.
Actual Result
Not a bug report against the current condition. cd05479 (#19645) removed not: 'foreign' deliberately, for BannerPlugin parity and to fix #19320; the try-catch IIFE makes it safe for strict-init node_modules.
The browser-side cost looks unmeasured. One Next 16.3.6 app:
browser (.next/static)
server (.next/server)
Injection sites
5,236
11,461
Files carrying them
170
704
Stripping each try{...}catch(){} span and re-gzipping:
Raw added
1,279.8 kB
Gzipped added
93.6 kB
Gzipped per site
18.3 B
Gzipped floor in rootMainFiles, every route
9.3 kB / 607 sites
First Load JS across 113 routes: +11.2 to +29.0 kB, median +13.1, integration included.
Each site evaluates new Error().stack twice at module-evaluation time.
Additional Context
Asking for an opt-out, not a change of default: a flag to exclude foreign modules, or a user-supplied condition for the rule.
#19320 was about the contains behaviour, which uses some and does need node_modules tagged. The exclusively behaviour uses every, so untagged dependency frames only change errors whose frames sit entirely inside bundled dependencies. Apps using exclusively against injected in-app-browser scripts get little for the 93.6 kB.
We added the same matcher with condition: { not: 'foreign' } pointing at moduleMetadataInjectionLoader.js. It halved our median route cost, but resolves a path outside your exports map.
Activity
linear-code commentedon Oct 27, 2026
JS-4006