-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
What's the issue ?
When the user cancel a fetcher request there is chance the website crashes.
The user can cancel a fetcher request when he navigates, reload the page...
Reproduction
I made a stackblitz to reproduce the issue:
https://stackblitz.com/edit/github-58exc72b?file=app%2Froutes%2Fhome.tsx
Basically, I added a useEffect that trigger a fetcher.load every 100ms, if you try to cancel the reload of the page you will see that the page crashes.
1/ Go to https://stackblitz.com/edit/github-58exc72b?file=app%2Froutes%2Fhome.tsx
2/ Open the preview in a new tab (to test it in Chrome for example):
3/ Then you will have to try to cancel the page reload, like this:
Screencast.from.20-08-2025.12.02.12.webm
Observations
I noticed that using the native fetch instead of useFetcher resolve the issue
System Info
React router ^7.8.1Expected Behavior
The page shouldn't crash if the user cancel the page reload.
Actual Behavior
When the user cancel the page reload then it crashes and fallback to the ErrorBoundary component:
