[TS Error] Can't export useQuery result
I'm currently getting the following TS error which I can't really resolve when trying to export a useQuery result:
Code:
The only workaround I found is to change the code the following way (But this isn't really a solution for me):
A common workaround for this issue is also to set the
compilerOptions.declaration
option in the tsconfig.json
to false. But I can't do this as I need the declaration files.
Here are also some informations I found about this error: https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189
Can someone help me on how to properly fix this issue or is this maybe also a bug in the library?GitHub
"The inferred type of X cannot be named without a reference to Y" (...
Bug Report 🔎 Search Terms TS2742 cannot be named without a reference 🕗 Version & Regression Information Problems occurs with 4.5.x and 4.6.x and most likely earlier versions (I've tried a f...
1 Reply
fair-roseOP•2y ago
Just saw that there is actually already a GH issue about this. So I guess this can be resolved
https://github.com/TanStack/query/issues/6318
GitHub
[vue-query]: Fresh Vue3 project + Tanstack - Typescript errors, Thi...
Describe the bug With a fresh Vue3 installation with @tanstack/vue-query installed - VSCode produces typescript errors, as seen in the screenshot. It's not clear to me if this is an issue with ...