mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix: force refresh on chunk preload error (#7600)
* fix: force refresh on preload error * misc: add comment * Update PendingNavigation.tsx
This commit is contained in:
parent
ec8230b7ba
commit
feb9cf01ed
1 changed files with 7 additions and 1 deletions
|
@ -70,7 +70,13 @@ class PendingNavigation extends React.Component<Props, State> {
|
||||||
this.routeUpdateCleanupCb();
|
this.routeUpdateCleanupCb();
|
||||||
this.setState({nextRouteHasLoaded: true});
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue