Title: `@sentry/nextjs` aborts Next.js Cache Components renders on Cloudflare Workers when requests overlap · Issue #25245 · getsentry/sentry-javascript · GitHub
Open Graph Title: `@sentry/nextjs` aborts Next.js Cache Components renders on Cloudflare Workers when requests overlap · Issue #25245 · getsentry/sentry-javascript
X Title: `@sentry/nextjs` aborts Next.js Cache Components renders on Cloudflare Workers when requests overlap · Issue #25245 · 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/25245
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`@sentry/nextjs` aborts Next.js Cache Components renders on Cloudflare Workers when requests overlap","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\nNot relevant. The problem occurs with `Sentry.init({})` and no DSN.\n\n### Which SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n11.6.0 and 10.71.0. Both are affected. The stack and the two `Sentry.init` option rows below are from 10.71.0.\n\n### Framework Version\n\nNext.js 16.3.8 with `cacheComponents: true`, on Cloudflare Workers (`@opennextjs/cloudflare` 1.20.10 and the build of opennextjs/opennextjs-cloudflare#1318, workerd 1.20261006.1, compatibility date 2025-09-15)\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nhttps://github.com/kmsomebody/cache-components-repro\n\n`instrumentation.ts` calls `Sentry.init({})` for the `nodejs` runtime.\n\nI changed these versions in the repository: `next` 16.3.8, `@opennextjs/cloudflare` 1.20.10, `wrangler` 4.149.0, `@sentry/nextjs` 11.6.0. For 11.6.0, `next.config.ts` imports `withSentryConfig` from `@sentry/nextjs/config`.\n\n### Steps to Reproduce\n\n1. Build the app with `opennextjs-cloudflare build` and start it with `opennextjs-cloudflare preview`.\n2. Open `/` in a browser. The page prefetches `/static` and `/dynamic`.\n3. Look at the two prefetch requests that have the header `next-router-prefetch: 3`.\n\nThree requests in flight are necessary. Sequential requests are correct.\n\n### Expected Result\n\nThe responses are the same as with `next start`. The `/static` prefetch has 174538 bytes and the `/dynamic` prefetch has 1970 bytes.\n\n### Actual Result\n\nThe body of each prefetch is one byte, `~`, which is the Next.js marker for a partial response. This occurs in 28 to 30 of 30 concurrent requests. With `next start`, it occurs in 0 of 30.\n\n### Additional Context\n\n`prepareSafeIdGeneratorContext` keeps one `AsyncLocalStorage.snapshot()` for all requests. On workerd, a snapshot is bound to the request that made it. This is the default from compatibility date 2025-06-16. When a different request calls the snapshot, it throws. The wrapper then takes a new snapshot in the current context and stores it for all requests.\n\nWhen requests overlap, a request finds a snapshot from a different request while it renders. It takes the new snapshot inside the Next.js prerender context, so the \"safe\" context is no longer outside the render. `uuid4` then calls `crypto.randomUUID()` there, and Next.js stops the prerender. This is the stack, with the minified names replaced:\n\n```\nRoute /static needs to bail out of prerendering at this point because it used `crypto.randomUUID()`.\n at abortOnSynchronousPlatformIOAccess\n at io\n at webCrypto.randomUUID\n at withRandomSafeContext\n at uuid4\n at generateTraceId\n at new Scope\n at Scope.clone\n at buildContextWithSentryScopes\n at SentryAsyncLocalStorageContextManager.with\n at ContextAPI.with\n at NextTracerImpl.trace\n```\n\nResults with 30 concurrent prefetch requests for each route:\n\n| Change | One-byte bodies |\n| --- | --- |\n| None, `Sentry.init({})` | 28 to 30 of 30 |\n| `Sentry.init({ enabled: false })` | 29 to 30 of 30 |\n| `Sentry.init({ skipOpenTelemetrySetup: true })` | 0 of 30 |\n| workerd flag `do_not_bind_asynclocalstorage_snapshot_to-request` | 0 of 30 |\n\nThe worker bundle contains the Node.js server build of the SDK, not the edge build.\n\n#21510 was a different cause of the same Next.js error.\n","author":{"url":"https://github.com/NathanDrake2406","@type":"Person","name":"NathanDrake2406"},"datePublished":"2026-10-11T05:20:15Z","url":"https://github.com/getsentry/sentry-javascript/issues/25245"}
| 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:8d2c9302-330e-748f-73ff-c173050c8e8a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DDE:F4D72:2546A8:32B263:6B043334 |
| html-safe-nonce | b94ed723d8900f8ccf16a391dbb92c91a947500df6fa958dd5ebe5877801925d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RERFOkY0RDcyOjI1NDZBODozMkIyNjM6NkIwNDMzMzQiLCJ2aXNpdG9yX2lkIjoiMTEwOTkxNTE5MTQxMzU4NDY5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ac9ed2b425b2aa72bbcae6bae3a15ab1db5a0380d40316aa4f7276a061e85532 |
| hovercard-subject-tag | issue:5798235043 |
| 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/25245/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4dc2c767f2286bd023b1177f982bbe3150c1d0b602121650b80c92a0f9c0c1d8/getsentry/sentry-javascript/issues/25245 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4dc2c767f2286bd023b1177f982bbe3150c1d0b602121650b80c92a0f9c0c1d8/getsentry/sentry-javascript/issues/25245 |
| 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 | NathanDrake2406 |
| 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