You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Solid Suspense is triggered on data access after checking isSuccess when loaded by ensureQueryData #9955
Hi there, I'm running into a weird issue where a suspense is being triggered even after checking that isSuccess is true, but only if the data was loaded from an ensureQueryData call (I've only tested this from a createFileRoute loader, maybe that's somehow related?).
It seems like somehow the Solid resource ends up behind the query. I'm not very familiar with the TanStack or Solid code, but in digging through the debugger in Chrome I found this suspect situation. The getter on the query identifies that the data exists (and while I'm here I can see the isSuccess set to true) and tries to load the latest data from the Solid resource:
But the Solid resource doesn't believe the fetcher was resolved yet, leading to it triggering a read which adds to the suspense context instead of just returning the value:
Visit the posts page (/posts) in the sandbox, and observe that the wasMounted signal remains false.
Uncomment the loader section (in src/routes/posts.tsx), and observe that the Suspense fallback is mounted.
Expected behavior
I expect that the query data getter would behave the same no matter how the data was initially loaded.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
OS: macOS
Browser: Safari 26.1, Chrome 142.0
Tanstack Query adapter
solid-query
TanStack Query version
5.90.12
TypeScript version
5.9.3
Additional context
I realize this seems like a tiny bug, and in almost any case I don't think it'd even be perceptible, but unfortunately the suspense is a significant problem for me because it breaks the iframe that Square's web payments SDK generates.
I just ran into this issue as well. It's not an obvious issue in DOM applications. However, it is clearly noticeable in environments where unmount + remount is expensive; like nativescript applications.
Found a workaround till the fix gets merged, I assume they are waiting on solid v2
consthideReasoningDuringGeneration=useQuery(()=>queries.userMetadata.byId(USER_METADATA_KEYS.HIDE_REASONING_DURING_GENERATION));// HACK: upstream tanstack query has a bug where it triggers suspense even// if the data is already there if it's loaded by ensureQueryData()// we wrap it in a resource to bypass thisconst[hideReasoning,{ mutate }]=createResource(()=>hideReasoningDuringGeneration.isSuccess&&hideReasoningDuringGeneration.data==='false');createEffect(()=>mutate(hideReasoningDuringGeneration.isSuccess&&hideReasoningDuringGeneration.data==='false'));
Activity
obedm503 commentedon Aug 2, 2026
I just ran into this issue as well. It's not an obvious issue in DOM applications. However, it is clearly noticeable in environments where unmount + remount is expensive; like nativescript applications.
vanillacode314 commentedon Aug 15, 2026
Found a workaround till the fix gets merged, I assume they are waiting on solid v2
refetchOnMount: falsecauses suspenses when mutating #9883 as a duplicate of this issue