mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1026] [MERGED] fix(hmr): await router state readiness before rsc:update dispatch #1030
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#1030
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/1026
Author: @james-elicx
Created: 5/2/2026
Status: ✅ Merged
Merged: 5/2/2026
Merged by: @james-elicx
Base:
main← Head:fix/hmr-router-state-race📝 Commits (3)
bee2ab4fix(hmr): await router state readiness before rsc:update dispatch888897bfix(hmr): re-check browserRouterStateRef after readiness await5ba2a1dfix(hmr): re-check setter after createPendingNavigationCommit await📊 Changes
1 file changed (+18 additions, -0 deletions)
View changed files
📝
packages/vinext/src/server/app-browser-entry.ts(+18 -0)📄 Description
Summary
rsc:updateHMR handler inapp-browser-entry.tscalledgetBrowserRouterState()directly, which throws whenbrowserRouterStateRefis null.browserRouterStateRefis only published insideBrowserRoot's layout effect, so an HMR event that fires while the initial RSC stream is still suspended (or after the tree has been torn down by an error) produces a noisy console error:[vinext] RSC HMR error: Error: [vinext] Browser router state is not initialized.waitForBrowserRouterStateReady()at the top of the handler, mirroring the pattern already used by__VINEXT_RSC_NAVIGATE__.Test plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.