Skip to content

Don't trigger error boundary prior to lazy route discovery manifest mismatch reload #13480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
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