next.js
0f851c5e - Fix params leaking into instant navigation shell in dev (#90455)

Commit
17 hours ago
Fix params leaking into instant navigation shell in dev (#90455) Populate `fallbackRouteParams` in the `isDebugStaticShell` prerender path so that params suspend correctly during instant navigation shell rendering in dev mode. When the instant lock is active, the server forces pages through the prerender path (`isDebugStaticShell`). During a prerender, `cookies()`, `searchParams`, and `connection()` all return hanging promises unconditionally, but params only suspends if `fallbackRouteParams` is set. Previously, only `isDebugFallbackShell` populated it — now `isDebugStaticShell` does too. This fixes both the MPA and SPA cases: the MPA HTML shell no longer contains resolved param values, and the SPA segment prefetch data no longer includes them either. Also adds a safety net: if the prefetch fails while the instant lock is held, the navigation waits for the lock to be released before falling through, preventing silent data leakage from future bugs. ## Test plan - `pnpm test-start-turbo test/e2e/app-dir/instant-navigation-testing-api/` — 16/16 pass - `pnpm test-dev-turbo test/e2e/app-dir/instant-navigation-testing-api/` — 16/16 pass - Manual verification via DevTools toggle: shell shows title + fallback, params are blocked until lock is released --------- Signed-off-by: Andrew Clark <git@andrewclark.io>
Author
Parents
Loading