-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Describe the bug
I'm using useSuspenseQuery with retry: false and a low gcTime (started with 0, but the same problem can be observed for gcTimes which are generally lower than 1s. When the query throws an error, it is retried infinitely, or at least multiple times with a low gcTime which is not 0.
Your minimal, reproducible example
https://github.com/foxable/reproduction-react-query-suspense-infinite-retry/tree/main
Steps to reproduce
- Run
npm run dev - Open http://localhost:3000/
Expected behavior
I expected the query to run only once on both the server and the client, but on the client it is retried infinitely (the same happens on the server when setting gcTime: 0.
Setting retryOnMount: false does not change this behavior.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Linux
- Browser: Firefox, Chrome
Tanstack Query adapter
react-query
TanStack Query version
v5.51.21
TypeScript version
v5.5.4
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels