diff --git a/packages/docusaurus/src/client/PendingNavigation.tsx b/packages/docusaurus/src/client/PendingNavigation.tsx index e1e38f40f817..3c1eaaf0dae3 100644 --- a/packages/docusaurus/src/client/PendingNavigation.tsx +++ b/packages/docusaurus/src/client/PendingNavigation.tsx @@ -70,7 +70,13 @@ class PendingNavigation extends React.Component { this.routeUpdateCleanupCb(); this.setState({nextRouteHasLoaded: true}); }) - .catch((e: unknown) => console.warn(e)); + .catch((e: unknown) => { + console.warn(e); + // If chunk loading failed, it could be because the path to a chunk + // no longer exists due to a new deployment. Force refresh the page + // instead of just not navigating. + window.location.reload(); + }); return false; }