mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #796] Synchronous rapid navigation triggers full page reload instead of soft RSC navigation #173
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#173
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?
Originally created by @Divkix on GitHub (Apr 8, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/796
Problem
During truly synchronous rapid A→B→C navigation (both clicks fired in the same JavaScript execution tick), vinext triggers a full page reload instead of completing a soft RSC navigation.
Evidence
E2E test
rapid-navigation.spec.tswas modified in PR #745 to verify no full page reload occurs during rapid navigation:Result:
__NAV_MARKER__isundefined, indicating a full page reload wiped all JavaScript state.Key Observations
No error logged: No
[vinext] RSC navigation error:appears in console, ruling out the catch block atapp-browser-entry.ts:809as the source.Works with sequential clicks: If the two clicks have even a tiny delay (sequential
page.click()calls), navigation completes correctly.Same-route navigation passes: The
same-route query change during cross-route navigationtest passes with the same synchronous click pattern.Difference Between Passing and Failing
isSameRoutetruefalseThis suggests the issue is related to cross-route navigation behavior when
isSameRoute = false.Root Cause Hypothesis
When
isSameRoute = false, the navigation usesuseTransition = falseinrenderNavigationPayload(). Combined with truly synchronous clicks:isSameRoute = falseactiveNavigationId,pendingPathname,navigationSnapshotActiveCount) may have an edge casewindow.location.href = hrefwithout logging an errorPotential trigger points for hard navigation without error logging:
app-browser-entry.ts:728— redirect handling (unlikely, no redirect involved)app-browser-entry.ts:809— catch block (but no error is logged)navigateClientSide()(unlikely, same-origin URLs)Investigation Needed
Add diagnostic logging: Temporarily add
console.logbefore everywindow.location.hrefassignment to identify which code path triggers the reload.Check state at navigation start: Log
activeNavigationId,pendingPathname,navigationSnapshotActiveCountwhen each navigation starts.Compare with Next.js behavior: Verify if Next.js handles synchronous rapid navigation differently.
Related
isSameRouteclassification (broader issue, fixed by PR #745)pendingPathnametracking to fixisSameRouteraceWorkaround
The E2E test was updated to remove the marker check, allowing CI to pass while this is investigated. The test still covers rapid navigation but without verifying the no-reload invariant.
Files Affected
packages/vinext/src/server/app-browser-entry.ts— RSC navigation logicpackages/vinext/src/shims/link.tsx— Link click handlerpackages/vinext/src/shims/navigation.ts— Client navigation stateSeverity
High — Full page reload during what should be a smooth client-side navigation breaks the SPA experience and loses all client-side state.