fix: fall back to full navigation when partial redirect has no partials (#3716)

Fixes #2560

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bartek Iwańczuk
2026-03-29 19:42:08 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 29cfed5b14
commit 14cff12fcc
+12 -2
View File
@@ -306,11 +306,21 @@ async function fetchPartials(
}
}
try {
await applyPartials(res);
} catch (err) {
// When a redirect leads to a page without partials, fall back
// to a full page navigation instead of silently failing.
if (err instanceof NoPartialsError && res.redirected) {
location.href = actualUrl.href;
return;
}
throw err;
}
if (shouldNavigate) {
maybeUpdateHistory(actualUrl);
}
await applyPartials(res);
}
interface PartialReviveCtx {