Skip to content

Commit 14cff12

Browse files
bartlomiejuclaude
andauthored
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>
1 parent 29cfed5 commit 14cff12

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

packages/fresh/src/runtime/client/partials.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,21 @@ async function fetchPartials(
306306
}
307307
}
308308

309+
try {
310+
await applyPartials(res);
311+
} catch (err) {
312+
// When a redirect leads to a page without partials, fall back
313+
// to a full page navigation instead of silently failing.
314+
if (err instanceof NoPartialsError && res.redirected) {
315+
location.href = actualUrl.href;
316+
return;
317+
}
318+
throw err;
319+
}
320+
309321
if (shouldNavigate) {
310322
maybeUpdateHistory(actualUrl);
311323
}
312-
313-
await applyPartials(res);
314324
}
315325

316326
interface PartialReviveCtx {

0 commit comments

Comments
 (0)