Repository navigation
fix(nextjs): Don't abort Cache Components renders on Cloudflare Workers when requests overlap - #25315
Merged
Merged
Conversation
Member
Author
|
bugbot run |
Contributor
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.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 41 successful. See the run.
Successful checks
|
…rs when requests overlap Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e Components E2E app Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
chargome
force-pushed
the
js-3906-continue-work
branch
from
November 3, 2026 10:52
d820bb9 to
6dcfd5b
Compare
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ 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.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
chargome
marked this pull request as ready for review
November 3, 2026 16:49
chargome
requested review from
JPeer264,
Lms24,
andreiborza,
logaretm,
mydea,
nicohrubec and
s1gr1d
and removed request for
a team,
Lms24,
mydea,
nicohrubec and
s1gr1d
November 3, 2026 16:49
logaretm
reviewed
Nov 3, 2026
…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 <noreply@anthropic.com>
… 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 <noreply@anthropic.com>
mydea
approved these changes
Nov 4, 2026
logaretm
approved these changes
Nov 4, 2026
51 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Fixes a bug where
@sentry/nextjson 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:
globalThis. On older Next.js versions the Cloudflare case stays as before.@sentry/coreonly 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/nextjsnow 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