query icon indicating copy to clipboard operation
query copied to clipboard

Solid: `refetchOnMount: false` causes suspenses when mutating

Open teidesu opened this issue 3 months ago • 0 comments

Describe the bug

this is a very weird bug that was a pain to debug due to that

i've been able to narrow it down to this:

  • given a QueryClient with refetchOnMount: false
  • and a useQuery that already has some data cached
  • the first mutation will cause a suspense to trigger

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-query-qltuvrie?file=src%2Findex.tsx

Steps to reproduce

  1. open repro
  2. open devtools
  3. click "mutate"
  4. notice how the dom tree below the suspense is re-added, and Suspense triggered is logged
  5. click a few more times, notice how the suspense is not triggered

Expected behavior

Suspense is not triggered

How often does this bug happen?

Every time

Screenshots or Videos

https://github.com/user-attachments/assets/9098b06f-452b-4cbf-bab1-60d8515f2126

Platform

  • OS: macOS
  • Browser: Chrome 142
  • Version: solid-query 5.90.13, solid 1.9.10

Tanstack Query adapter

solid-query

TanStack Query version

5.90.13

TypeScript version

5.8.3

Additional context

No response

teidesu avatar Nov 18 '25 02:11 teidesu