From 14cff12fcc21945fbfbc0997e3ffd7b198e45c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 29 Mar 2026 19:42:08 +0000 Subject: [PATCH] fix: fall back to full navigation when partial redirect has no partials (#3716) Fixes #2560 --------- Co-authored-by: Claude Opus 4.6 (1M context) --- packages/fresh/src/runtime/client/partials.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/fresh/src/runtime/client/partials.ts b/packages/fresh/src/runtime/client/partials.ts index f1c8c884..8ffcd236 100644 --- a/packages/fresh/src/runtime/client/partials.ts +++ b/packages/fresh/src/runtime/client/partials.ts @@ -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 {