Title: nextjs: Turbopack applicationKey metadata adds 93.6 kB gzip to the browser bundle; opt-out for node_modules? · Issue #25754 · getsentry/sentry-javascript · GitHub
Open Graph Title: nextjs: Turbopack applicationKey metadata adds 93.6 kB gzip to the browser bundle; opt-out for node_modules? · Issue #25754 · getsentry/sentry-javascript
X Title: nextjs: Turbopack applicationKey metadata adds 93.6 kB gzip to the browser bundle; opt-out for node_modules? · Issue #25754 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25754
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nextjs: Turbopack applicationKey metadata adds 93.6 kB gzip to the browser bundle; opt-out for node_modules?","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n10.76.1 (same rule on 11.9.0 and develop)\n\n### Framework Version\n\n16.3.6\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n```ts\n// next.config.ts\nexport default withSentryConfig(nextConfig, { applicationKey: \"my-app\" })\n\n// instrumentation-client.ts\nSentry.init({\n dsn: \"...\",\n integrations: [\n Sentry.thirdPartyErrorFilterIntegration({\n filterKeys: [\"my-app\"],\n behaviour: \"apply-tag-if-exclusively-contains-third-party-frames\",\n }),\n ],\n})\n```\n\n### Steps to Reproduce\n\n1. Set `applicationKey` on a Next 16 app building with Turbopack.\n2. `next build` with it and without it.\n3. Compare First Load JS per route, and count `_sentryModuleMetadata[...stack]=Object.assign` in `.next/static`.\n\n### Expected Result\n\nA supported way to keep `thirdPartyErrorFilterIntegration` without tagging every bundled dependency.\n\n### Actual Result\n\nNot a bug report against the current condition. cd05479c (#19645) removed `not: 'foreign'` deliberately, for BannerPlugin parity and to fix #19320; the try-catch IIFE makes it safe for strict-init node_modules.\n\nThe browser-side cost looks unmeasured. One Next 16.3.6 app:\n\n| | browser (`.next/static`) | server (`.next/server`) |\n| --- | ---: | ---: |\n| Injection sites | 5,236 | 11,461 |\n| Files carrying them | 170 | 704 |\n\nStripping each `try{...}catch(){}` span and re-gzipping:\n\n| | |\n| --- | ---: |\n| Raw added | 1,279.8 kB |\n| Gzipped added | 93.6 kB |\n| Gzipped per site | 18.3 B |\n| Gzipped floor in `rootMainFiles`, every route | 9.3 kB / 607 sites |\n\nFirst Load JS across 113 routes: **+11.2 to +29.0 kB, median +13.1**, integration included.\n\nEach site evaluates `new Error().stack` twice at module-evaluation time.\n\n### Additional Context\n\nAsking for an opt-out, not a change of default: a flag to exclude foreign modules, or a user-supplied condition for the rule.\n\n#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.\n\nWe 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.\n\nRelated: #19320, #19645, #25544 / #25565, #23402.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>\n","author":{"url":"https://github.com/fmguerreiro","@type":"Person","name":"fmguerreiro"},"datePublished":"2026-10-27T08:24:57Z","url":"https://github.com/getsentry/sentry-javascript/issues/25754"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:65cfb734-da3f-2c30-b4b5-96a6e0cb0791 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D014:1B23D4:FD839:168A32:6B0415D3 |
| html-safe-nonce | a084aaa34d3689cba3b2a62b60a875397cd057c3e0e4b28c5681ff2e4284c38c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDE0OjFCMjNENDpGRDgzOToxNjhBMzI6NkIwNDE1RDMiLCJ2aXNpdG9yX2lkIjoiMzA5NzMxMTQxOTU4MzE3NDA5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 06fb38d84d261fe5034c84bb6ce795366e9eb3478d7254c7cf9d58fa9ccbc14a |
| hovercard-subject-tag | issue:6055546772 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25754/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3608b00b113c6967fc21daacac2c101eadf966dc06fd5da459a973b5150c454/getsentry/sentry-javascript/issues/25754 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3608b00b113c6967fc21daacac2c101eadf966dc06fd5da459a973b5150c454/getsentry/sentry-javascript/issues/25754 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fmguerreiro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width