GeezerVison is showing github.com — fix(nextjs): Don't abort Cache Components renders on Cloudflare Workers when requests overlap by chargome · Pull Request #25315 · getsentry/sentry-javascript
Conversation
chargome
commented
Oct 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What
Fixes a bug where @sentry/nextjs on Cloudflare Workers broke Next.js Cache Components pages when two requests ran at the same time. One of the requests came back as an empty page.
Next.js has a check that fails a render when random values (like trace or span IDs) are generated during it. To avoid that, the SDK generates its IDs outside the render. On Cloudflare Workers that mechanism broke in two ways, both fixed here:
- The SDK stepped out of the render using a snapshot that Cloudflare ties to a single request. When a second request reused it, the snapshot was rebuilt inside that request's render and triggered the check. The SDK now exits the Next.js render store directly, which Next.js 16.4 and newer expose on
globalThis. On older Next.js versions the Cloudflare case stays as before.
@sentry/core only looks for the SDK hook once. On Cloudflare the Worker's copy of core generated its first ID before Next.js loaded and missed the hook forever. The Cloudflare entry of @sentry/nextjs now sets the hook up when the Worker starts.
Also adds an optional Cloudflare e2e variant for the Cache Components app with a test that fires overlapping requests.
Why
Users running Cache Components on Cloudflare Workers saw random pages fail under normal traffic, see #25245.
The new e2e variant is optional because released OpenNext does not run Cache Components renders on Cloudflare yet (opennextjs/opennextjs-cloudflare#1318). The fix was verified locally against their preview build of that PR.
Fixes #25245
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
Compared: 0b6fa31 (PR test merge using develop at f2ee787)
Against: f2ee787 (develop) · base run #65001
✅ Baseline matches: this diff contains only this PR's changes.
| Path |
Size |
% Change |
Change |
| @sentry/browser |
30.4 kB |
- |
- |
| @sentry/browser - with treeshaking flags |
28.54 kB |
- |
- |
| @sentry/browser - with treeshaking flags tracing without tracing |
28.43 kB |
- |
- |
| @sentry/browser (incl. Tracing) |
52.72 kB |
- |
- |
| @sentry/browser (incl. Tracing + Span Streaming) |
52.72 kB |
- |
- |
| @sentry/browser (incl. Tracing, Profiling) |
55.69 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) |
93.02 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
81.61 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
97.76 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
110.75 kB |
- |
- |
| @sentry/browser (incl. Feedback) |
47.98 kB |
- |
- |
| @sentry/browser (incl. sendFeedback) |
35.5 kB |
- |
- |
| @sentry/browser (incl. FeedbackAsync) |
40.61 kB |
- |
- |
| @sentry/browser (incl. Metrics) |
31.44 kB |
- |
- |
| @sentry/browser (incl. Logs) |
31.73 kB |
- |
- |
| @sentry/browser (incl. Metrics & Logs) |
32.45 kB |
- |
- |
| @sentry/react |
32.29 kB |
- |
- |
| @sentry/react (incl. Tracing) |
55.09 kB |
- |
- |
| @sentry/vue |
38.67 kB |
- |
- |
| @sentry/vue (incl. Tracing) |
55.73 kB |
- |
- |
| @sentry/svelte |
30.43 kB |
- |
- |
| @sentry/remix (Remix 3 client bundle) |
57.8 kB |
- |
- |
| CDN Bundle |
32.19 kB |
- |
- |
| CDN Bundle (incl. Tracing) |
53.24 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) |
34.47 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) |
55.19 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) |
75.88 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) |
91.46 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) |
93.39 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
97.56 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) |
99.56 kB |
- |
- |
| CDN Bundle - uncompressed |
94.67 kB |
- |
- |
| CDN Bundle (incl. Tracing) - uncompressed |
157.63 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) - uncompressed |
101.14 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed |
163.37 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed |
232.71 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
279.32 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed |
285.05 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
293.03 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed |
298.74 kB |
- |
- |
| @sentry/nextjs (client) |
58.04 kB |
- |
- |
| @sentry/sveltekit (client) |
53.23 kB |
- |
- |
| @sentry/core/server |
44.25 kB |
- |
- |
| @sentry/core/browser |
13.93 kB |
- |
- |
| @sentry/node |
155.71 kB |
+0.02% |
+18 B 🔺 |
| @sentry/node/import (ESM hook with diagnostics-channel injection) |
82.26 kB |
- |
- |
| @sentry/node - without tracing |
96.89 kB |
+0.02% |
+16 B 🔺 |
| @sentry/node - without channel injection |
136.04 kB |
+0.02% |
+20 B 🔺 |
| @sentry/aws-serverless |
105.11 kB |
+0.02% |
+21 B 🔺 |
| @sentry/cloudflare (withSentry) - minified |
200.67 kB |
- |
- |
| @sentry/cloudflare (withSentry) |
499.05 kB |
- |
- |
| @sentry/nextjs/cloudflare (withSentry) - minified |
222.65 kB |
+0.65% |
+1.42 kB 🔺 |
View base workflow run
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Optional E2E tests
Some optional checks were not successful. They do not block the merge. 2 not successful, 41 successful. See the run.
|
Check |
Status |
|
| ❌ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) |
Failing after 1m |
Details |
| ❌ |
CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) |
Failing after 4m |
Details |
Successful checks
|
Check |
Status |
|
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-flue Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7 Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-pi-durable Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) |
Successful in 4m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) |
Successful in 58s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-mastra Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) |
Successful in 52s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) |
Successful in 5m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think Test (optional) |
Successful in 4m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7-static Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E solidstart-2 Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) |
Successful in 48s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) |
Successful in 4m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) |
Successful in 4m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) |
Successful in 4m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E deno (latest) Test (optional) |
Successful in 2m |
Details |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6dcfd5b. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ntry
Registers the runner at module scope of `@sentry/nextjs/cloudflare`, which runs at isolate startup before the
Worker's copy of `@sentry/core` generates its first ID. This restores the one-time runner resolution in core, so
SDKs without a runner don't look it up on every random value. Also leaves `traceLifecycle` unset in the Cache
Components Worker.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
… Worker
On Workers the request transaction belongs to the `withSentry` client. The specs of this app wait for transaction
envelopes, so with span streaming in the Worker they time out even when the pages render (verified against the
OpenNext preview of opennextjs/opennextjs-cloudflare#1318).
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|