From 68cddbbdd5099c1d4a11fe6e04181e2d6c2b1036 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 21:31:37 +0000 Subject: [PATCH] Refactor: Implement chunk load error recovery --- src/App.tsx | 3 ++ src/components/error/RouteErrorBoundary.tsx | 35 +++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5085e78a..d8a4a1d9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -120,6 +120,9 @@ function NavigationTracker() { const from = prevLocation.current || undefined; breadcrumb.navigation(location.pathname, from); prevLocation.current = location.pathname; + + // Clear chunk load reload flag on successful navigation + sessionStorage.removeItem('chunk-load-reload'); }, [location.pathname]); return null; diff --git a/src/components/error/RouteErrorBoundary.tsx b/src/components/error/RouteErrorBoundary.tsx index 6c071cda..06471e7e 100644 --- a/src/components/error/RouteErrorBoundary.tsx +++ b/src/components/error/RouteErrorBoundary.tsx @@ -32,13 +32,35 @@ export class RouteErrorBoundary extends Component @@ -63,10 +90,12 @@ export class RouteErrorBoundary extends Component - Something Went Wrong + {isChunkError ? 'New Version Available' : 'Something Went Wrong'} - We encountered an unexpected error. This has been logged and we'll look into it. + {isChunkError + ? "The app has been updated. Please reload the page to get the latest version." + : "We encountered an unexpected error. This has been logged and we'll look into it."}