Skip to content

[vue-query]: Fresh Vue3 project + Tanstack - Typescript errors, This is likely not a portable. #6318

Closed as not planned
@cadriel

Description

@cadriel

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 tanstack-query, vue3 - or typescript. There seems to be various issues around that suggest it might be any of them.

Its worth noting that the project still runs and produces expected results.

tanstack/vue-query does not have this issue on V4. It only occurs after moving to V5.

Your minimal, reproducible example

https://github.com/cadriel/tanstack-query-issue

Steps to reproduce

  1. Clone the example project. https://github.com/cadriel/tanstack-query-issue
  2. Open the project in VSCode - ensure you've installed and configured the Vue dev tools (Volar, etc..)
  3. See the error as per the screenshot above.

Expected behavior

I'd expect to not see any errors in VSCode, and for the types to be correctly inferred.

How often does this bug happen?

Every time

Screenshots or Videos

Screenshot 2023-11-06 at 10 38 54 AM

Platform

macOS, VSCode.

Tanstack Query adapter

vue-query

TanStack Query version

V5+

TypeScript version

V5.2.2 (as per npm create vue@latest)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions