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
42.5k stars 2.91k forks source link

Solid: Cannot access 'refetch' before initialization #7305

Open egoist opened 7 months ago

egoist commented 7 months 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
laptou commented 5 months ago

I'm getting this same error regardless of how I set deferStream.

TkDodo commented 3 months ago

@ardeora FYI