next.js
cfb4ac51 - fix: prevent incorrect searchParams being applied on certain navs (#76914)

Commit
296 days ago
fix: prevent incorrect searchParams being applied on certain navs (#76914) When the router returns an aliased prefetch for URLs to the same path but with different search params, there's the possibility that we trigger an MPA-style navigation if the path doesn't contain a valid flight payload (eg: a route handler, a `pages` router page, or an external URL). The logic to bail out of the alias handling was happening _after_ this, which meant the incorrect searchParams would be applied to the final URL. This ensures that if we bail out of applying the alias (eg because it's not a valid RSC payload, or the aliased entry has no reusable loading segment), then we re-run the navigation with a non-aliased entry. Fixes #75318 Closes NDX-804
Author
Parents
Loading