TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.09k stars 2.69k forks source link

Solid: Cannot access 'refetch' before initialization #7305

Open egoist opened 3 weeks ago

egoist commented 3 weeks ago

Describe the bug

When deferStream is false, the withError example here will be broken: https://stackblitz.com/edit/tanstack-query-aqydpb?file=src%2Froutes%2Fwith-error.tsx (forked from official solid start example)

Your minimal, reproducible example

https://stackblitz.com/edit/tanstack-query-aqydpb?file=src%2Froutes%2Fwith-error.tsx

Steps to reproduce

just remove deferStream or set it to false in the with-error example

Expected behavior

should show the actual error, instead of Cannot access 'refetch' before initialization

How often does this bug happen?

Often

Screenshots or Videos

CleanShot 2024-04-19 at 20 11 46@2x

Platform

Not relevant

Tanstack Query adapter

solid-query

TanStack Query version

5.30.6

TypeScript version

No response

Additional context

No response

### Tasks