Skip to content

network-only + React 19 creates phantom teardown requests #3802

@giacomocerquone

Description

@giacomocerquone

Describe the bug

Hello there. Thanks for all the work you put in this project!

This issue is most probably related to #3764 but it's different since the behavior I'm experiencing (both in dev and in production) appears in the network tab where some requests show as canceled (so not only a react warning).

I've created a repro here: https://github.com/giacomocerquone/urql-teardown-react19-router-bug where you also have a video showing both the urql's devtools and the network tab.

The TLDR of the problem is the following:

  1. react-router 7 in declarative mode (so the most basic possible way of moving between pages)
  2. React 19 and urql 4.2.2
  3. I have two pages containing two useQuery sharing the same query with a network-only policy
  4. When I navigate from Page1 to Page2, I see a first request being torn down and immediately after a new request which will actually return successfully.

Reproduction

https://github.com/giacomocerquone/urql-teardown-react19-router-bug

Urql version

Latest 4.2.2

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions