diff --git a/client/portal/src/components/ErrorPage.tsx b/client/portal/src/components/ErrorPage.tsx index 7a072863..9e37dc02 100644 --- a/client/portal/src/components/ErrorPage.tsx +++ b/client/portal/src/components/ErrorPage.tsx @@ -1,7 +1,8 @@ -import { ArrowLeft, Home } from "lucide-react"; +import { ArrowLeft, Home, RefreshCw } from "lucide-react"; import { isRouteErrorResponse, useNavigate, useRouteError } from "react-router"; import { Button } from "@/components/ui/button"; +import { isChunkLoadError } from "@/shared/lib/stale-chunk-reload"; /** * Static rather than the super admin's runtime `contact_email`: this page is @@ -78,6 +79,9 @@ export function ErrorPage() { const error = useRouteError(); const navigate = useNavigate(); const { status, label, title, message, detail } = describeError(error); + // A missing content-hashed chunk means this tab predates a deploy. Only a + // reload fetches the fresh shell; in-app navigation keeps the stale one. + const staleBuild = detail != null && isChunkLoadError(detail); return (
@@ -146,7 +150,19 @@ export function ErrorPage() { )} -
+ {staleBuild && ( + + )} + +