Open buddamus opened 2 months ago
I'm going to ask for a reproduction. I'd expect ErrorBoundary to be able to catch this. Albeit happening during routing it will be one up by the router. If it is not being caught by an ErrorBoundary then we have an issue. Also preload function may load on a preload event like a hover or as we enter the route, these impact how they error. I suppose a sync error might be handled differently than an async one which may be the source of the issue.
Duplicates
Latest version
Current behavior π―
If an error occurs on the prefetching of the route data, the user is redirected back to the previous page even though the URL in the browser shows the user landing at the destination.
For example,
?page=1
?page=2
but gets an error?page=2
remains in the browser window but data from?page=1
gets displayed againExpected behavior π€
User should land on the target route (and that target page's error handling will take over)
Steps to reproduce πΉ
Steps:
export const route = { preload({ location, params }) { if(params.page == 2){ throw('Testing this'); } } } satisfies RouteDefinition;
Context π¦
I am testing out my error messaging and ensuring my components are displaying that an error exists. Note: wrapping the prefetch in a try/catch gets me around the problem but I think I shouldn't have to do this.
Your environment π
No response