Open
Description
Describe the bug
When using the factory queryOptions
and exporting the result, TypeScript errors appear:
Exported variable 'shopsQuery' has or is using name 'dataTagErrorSymbol' from external module "/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H" but cannot be named. (ts4023)
Exported variable 'shopsQuery' has or is using name 'dataTagSymbol' from external module "/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H" but cannot be named. (ts4023)
These errors occur in every instance where I export the result of queryOptions
. Removing the export resolves the issue, but that isn't an acceptable workaround.
Your minimal, reproducible example
Steps to reproduce
- Install the latest version of @tanstack/react-query (v5.62.8).
- Create and export a variable using
queryOptions
factory, e.g.,export const shopsQuery = queryOptions(...);
. - Observe TypeScript errors as described.
Expected behavior
The queryOptions
factory should allow exporting without triggering TypeScript errors.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS [Windows, Linux]
Tanstack Query adapter
react-query
TanStack Query version
v5.62.8
TypeScript version
v5.7.2
Additional context
No response