TanStackT
TanStack4y ago
2 replies
colossal-harlequin

Typing issue in template in Intellij Webstorm

Hi, is anyone here using webstorm? I'm getting some wonky typing in the templates (whereas in the script block the types are correct).

VS Code works fine, and I've already submitted a Webstorm bug but just wondering if anyone has run into this and knows a workaround.

Vue 2.7/3
TS 4.7/4.9
@tanstack/vue-query 4.20.5

<script lang="ts" setup>
import { useQuery } from '@tanstack/vue-query'

const { isLoading, data } = useQuery({
  queryKey: ['destructured assignment'],
  queryFn: () => Promise.resolve<number>(1)
})

isLoading; // TS: Ref(false) | Ref(true)
data; // TS: Ref(number) | Ref(undefined)
</script>

<template>
  <div>
    {{ isLoading }} <!-- TS: any -->
    {{ data }} <!-- TS: any -->
  </div>
</template>
Was this page helpful?