mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#783
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/700
Author: @southpolesteve
Created: 3/28/2026
Status: ✅ Merged
Merged: 3/28/2026
Merged by: @southpolesteve
Base:
main← Head:fix/695-useeffect-not-firing-after-rsc-hydration📝 Commits (2)
7c56295fix: don't await createFromReadableStream before hydrateRoot (#695)96e238efix: move effect-test page to app-router-cloudflare example📊 Changes
3 files changed (+40 additions, -1 deletions)
View changed files
➕
examples/app-router-cloudflare/app/effect-test/page.tsx(+26 -0)📝
packages/vinext/src/server/app-browser-entry.ts(+1 -1)📝
tests/e2e/cloudflare-workers/hydration.spec.ts(+13 -0)📄 Description
Summary
Fixes #695 --
useEffectcallbacks never firing after RSC hydration on Cloudflare Workers.createFromReadableStreamreturns a React thenable, not a resolved component tree. Awaiting it before passing tohydrateRootblocked hydration until the entire RSC stream was consumed, which prevented passive effects from ever being scheduled.<script>tags, so the stream takes longer to close -- making the bug reliably reproducible there but not locally (where RSC data is available synchronously inwindow.__VINEXT_RSC__).awaitso the thenable is passed directly tohydrateRoot, matching the React RSC contract and the pattern already used inapp-ssr-entry.ts.Changes
packages/vinext/src/server/app-browser-entry.ts-- removeawaitoncreateFromReadableStream(line 182)tests/fixtures/cf-app-basic/app/effect-test/page.tsx-- new"use client"fixture page that usesuseEffectto flip a status flagtests/e2e/cloudflare-workers/hydration.spec.ts-- regression test that verifiesuseEffectfires after RSC hydration on the Workers e2e project🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.