You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constroutes=[{path: "/",errorElement: <ErrorPage/>,children: [{index: true,element: <Home/>},{path: "apps",children: [{index: true,asynclazy(){const{ Index }=awaitimport("./pages");// Hard-coded error simulating error fetching a chunk from the serverthrownewError("failed to fetch chunk");return{Component: Index};}}]}]}];
When could this happen?
As mentioned in the repro steps, this problem happens in production due to Cascading Cache Invalidation:
I deploy app to production
A user uses app, but doesn't navigate to lazy-loaded chunk (thus, never fetched and cached by the server)
I deploy a new version of app to production, overwriting the previous files
The same user in the same session navigates to lazy-loaded chunk
Lazy-loaded chunk fails to fetch because the production hash doesn't match the new deployment from step 3
Expected Behavior
errorElement is rendered.
Actual Behavior
Generic React error page is rendered.
The text was updated successfully, but these errors were encountered:
What version of React Router are you using?
6.9.0
Steps to Reproduce
errorElement
async lazy() {...}
(this simulates failure to fetch a chunk from a server, e.g. Cascading Cache Invalidation).errorElement
, expectedLink to sandbox repro-ing issue: https://codesandbox.io/s/laughing-elion-nsbvpy?file=/src/index.js
When could this happen?
As mentioned in the repro steps, this problem happens in production due to Cascading Cache Invalidation:
Expected Behavior
errorElement
is rendered.Actual Behavior
Generic React error page is rendered.
The text was updated successfully, but these errors were encountered: