Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silly-ligers-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

Don't trigger an `ErrorBoundary` UI before the reload when we detect a manifest verison mismatch in Lazy Route Discovery
8 changes: 7 additions & 1 deletion packages/react-router/lib/dom/ssr/fog-of-war.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,13 @@ export async function fetchAndApplyManifestPatches(

sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
window.location.href = errorReloadPath;
throw new Error("Detected manifest version mismatch, reloading...");
console.warn("Detected manifest version mismatch, reloading...");

// Stall here and let the browser reload and avoid triggering a flash of
// an ErrorBoundary if we threw (same thing we do in `loadRouteModule()`)
await new Promise(() => {
// check out of this hook cause the DJs never gonna re[s]olve this
});
} else if (res.status >= 400) {
throw new Error(await res.text());
}
Expand Down