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
Looks like an easy fix: just change TError=unknown to TError = DefaultError in /solid-query/src/queryOptions.ts, but I am no TS expert and maybe the problem is deeper
The text was updated successfully, but these errors were encountered:
This will be because the default type of TError in queryOptions is unknown and what you've passed in doesn't override this
There might be a good case to change TError = unknown to TError = DefaultError on queryOptions()
Otherwise you can define this yourself with queryOptions<Data, Error, ...etc> or by datatagging your query key ['key'] as DataTag<string[], Data, Error>
Describe the bug
When I am using queryOptions helper type of error erased and becomes unknown
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-query-shfzdsbz?file=src%2Findex.tsx
Steps to reproduce
see example above
Expected behavior
query.error type does not get erased
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
all
Tanstack Query adapter
solid-query
TanStack Query version
5.62.8
TypeScript version
Version 5.6.3
Additional context
Looks like an easy fix: just change TError=unknown to TError = DefaultError in /solid-query/src/queryOptions.ts, but I am no TS expert and maybe the problem is deeper
The text was updated successfully, but these errors were encountered: