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:
co-authored by
Claude Opus 4.6
parent
29cfed5b14
commit
14cff12fcc
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user