Skip to content

Page crashing on fetcher request cancelling (navigation/page reload cancel)Β #14203

@theocerutti

Description

@theocerutti

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):

Image

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.1

Expected 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:

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions