Skip to content
Source
Sign inSign up
TanStack/query

'Signal is aborted without reason' error on page navigation with Next.js #9877

Closedmrmps(GitHub profile, opens in a new tab) opened this issue 2 comments

Describe the bug

When using @tanstack/react-query with the Next.js App Router in development (reactStrictMode: true), navigating to a page with an active useQuery results in a 'signal is aborted without reason' error.

Here's a very minimal repo reproducing this issue: https://github.com/mrmps/react-query-error

It occurs for Next.js 13, 15, and 16.

Things I tried to fix:

  1. remove Link prefetch
  2. remove react-strict-mode (seems to slightly help, but the error is reproduced if you navigate quickly between pages.

If this is expected behavior, what's the recommended way to handle this?

Your minimal, reproducible example

https://github.com/mrmps/react-query-error

Steps to reproduce

  1. Clone repo
  2. pnpm install
  3. click the link to the problem page.

Expected behavior

I expect to not see this overlay:

Image

Instead it shows up every time. There's no issue with actual page behavior.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • MacOS
  • Chrome

Tanstack Query adapter

react-query

TanStack Query version

v^5.62.7

TypeScript version

"typescript": "^5"

Additional context

No response

  1. I tried out the reproduction locally and I’m not getting a nextJs overlay. Only the code where you console.error explicitly in the queryFn triggers it, which I guess is how nextJs works 🤷‍♂️

  2. TkDodo closed this

  3. TkDodo added labelsworks as designed

  4. I was able to narrow this problem down to the SimilarWeb chrome extension! Tanstack works as intended. Hope this saves someone else a headache

Sign in to join this conversation.