mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #546] [CLOSED] fix: eagerly preload client references to prevent first-request 500 #662
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#662
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/546
Author: @NathanDrake2406
Created: 3/15/2026
Status: ❌ Closed
Base:
main← Head:fix/first-request-500📝 Commits (3)
af5bc16fix: eagerly preload client references to prevent first-request 50054a510efix: remove brittle code-generation tests per review feedbackd538106perf: skip client reference preloading after first request📊 Changes
3 files changed (+100 additions, -0 deletions)
View changed files
📝
packages/vinext/src/entries/app-ssr-entry.ts(+20 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+20 -0)📝
tests/app-router.test.ts(+60 -0)📄 Description
Summary
Fixes #256.
vinext startreturns 500 because client reference modules are loaded lazily via asyncimport()in@vitejs/plugin-rsc'smemoize()cache__vite_rsc_client_require__returns an unresolved Promise. Without a<Suspense>boundary wrapping the root shell, React SSR rejects. Subsequent requests work because the cache is warm.app-ssr-entry.ts) viaPromise.allbeforerenderToReadableStreamrunsif (_clientReferences.default && globalThis.__vite_rsc_client_require__)for safetyTest plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.