Title: [nextjs] Isolation scope is not forked for proxy requests under the new `Next.request` root span (Next.js 16.4.3+) · Issue #26005 · getsentry/sentry-javascript · GitHub
Open Graph Title: [nextjs] Isolation scope is not forked for proxy requests under the new `Next.request` root span (Next.js 16.4.3+) · Issue #26005 · getsentry/sentry-javascript
X Title: [nextjs] Isolation scope is not forked for proxy requests under the new `Next.request` root span (Next.js 16.4.3+) · Issue #26005 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release — we run 10.78.0 in production; the same check exists in 11.10.0 (latest) and on develop (we comp...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release — we run 10.78.0 in production; the same check exists in ...
X Description: Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release — we run 10.78.0 in production; the same check exists in ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/26005
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[nextjs] Isolation scope is not forked for proxy requests under the new `Next.request` root span (Next.js 16.4.3+)","articleBody":"### Is there an existing issue for this?\n- [x] I have checked for existing issues\n- [x] I have reviewed the documentation\n- [ ] I am using the latest SDK release — we run 10.78.0 in production; the same check exists in 11.10.0 (latest) and on `develop` (we compared the code)\n\n### How do you use Sentry?\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n@sentry/nextjs\n\n### SDK Version\n10.78.0 (the relevant code is the same in 11.10.0 and on `develop`)\n\n### Framework Version\nNext.js 16.4.3\n\n### Link to Sentry event\nNot public.\n\n### Reproduction Example/SDK Setup\nApp Router with `proxy.ts`, default Turbopack build (so the proxy is not auto-wrapped with `wrapMiddlewareWithSentry`), deployed on Vercel where the proxy is invoked separately from the render. `tracesSampleRate: 0.1`, `tunnelRoute` set.\n\n### Steps to Reproduce\n1. Send a request without a `traceparent` header to a route that runs the proxy.\n2. Since vercel/next.js#100294 (shipped in 16.4.3), the proxy adapter starts a root span with `next.span_type = \"Next.request\"` (named after the method, e.g. `GET`), and `Middleware.execute` becomes its child.\n3. `maybeForkIsolationScopeForRootSpan` (`handleOnSpanStart` in 10.x) only forks the isolation scope when the root span type is `BaseServer.handleRequest` or `Middleware.execute`, so for this root it returns early.\n4. Record breadcrumbs inside the proxy (fetch, console) for two concurrent requests handled by the same instance, and capture an error in one of them.\n\n### Expected Result\nEach proxy request gets its own isolation scope, as it did when `Middleware.execute` was the root, so breadcrumbs do not mix between requests.\n\n### Actual Result\nProxy invocations share one isolation scope (we confirmed the shared scope with the real SDK in a local reproduction), so breadcrumbs recorded in the proxy can be attached to events of other concurrent requests.\n\n### Additional Context\n- Side effects we also see in production: the proxy transaction is now named `GET middleware GET` with op `http.server` (previously `middleware GET` / `http.server.middleware`), and `tunnelRoute` POSTs are no longer dropped by the middleware filter (they are sent as transactions, subject to the sample rate). The second part should go away once vercel/next.js#100665 lands, but requests that continue to a render keep the `Next.request` root, so the isolation scope issue remains.\n- With `next build --webpack` the proxy is auto-wrapped with `wrapMiddlewareWithSentry` (which uses `withIsolationScope`), so the impact is small there.\n- Related: #25370 (closed on 2026-10-27 as fixed by Next.js 16.4.3), vercel/next.js#100294, vercel/next.js#100665.\n- We have not published a minimal repro repository yet, but can provide one. We are also happy to open a PR with a fix and tests if you agree with the direction.\n","author":{"url":"https://github.com/tsuyoring","@type":"Person","name":"tsuyoring"},"datePublished":"2026-11-03T03:38:56Z","url":"https://github.com/getsentry/sentry-javascript/issues/26005"}
| 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:022cec88-b160-ddbb-a238-d8811a6657b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8880:2F022B:844E8:B6696:6B0431F8 |
| html-safe-nonce | 84368c9648845d751b68237479e734516114622acc1db2c5802ff67a0406b00f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODgwOjJGMDIyQjo4NDRFODpCNjY5Njo2QjA0MzFGOCIsInZpc2l0b3JfaWQiOiI4NDI3MzY1MTE1NjM4NzA3MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 137edd93a4def4518b3a60f643009c6835e8d95e9712d0e7c8b88f26738e3112 |
| hovercard-subject-tag | issue:6175807887 |
| 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/26005/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa65661a14364b82be66acfd8766d84002a11024a05b845fae76906be6fa5086/getsentry/sentry-javascript/issues/26005 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa65661a14364b82be66acfd8766d84002a11024a05b845fae76906be6fa5086/getsentry/sentry-javascript/issues/26005 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues I have reviewed the documentation I am using the latest SDK release — we run 10.78.0 in production; the same check exists in ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tsuyoring |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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