vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

infer type in template unexpectedly after v2.0.19 #4470

Open zcf0508 opened 1 week ago

zcf0508 commented 1 week ago

Vue - Official extension or vue-tsc version

2.0.21

VSCode version

1.91.0-insiders

Vue version

3.4.27

TypeScript version

latest

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-13490F
    Memory: 2.33 GB / 31.82 GB
  Binaries:
    Node: 20.14.0 - ~\.version-fox\cache\nodejs\current\node.EXE
    Yarn: 1.22.22 - ~\.version-fox\cache\nodejs\current\yarn.CMD
    npm: 10.7.0 - ~\.version-fox\cache\nodejs\current\npm.CMD
    pnpm: 9.1.4 - ~\.version-fox\cache\nodejs\current\pnpm.CMD
    bun: 1.1.12 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (125.0.2535.92)
    Internet Explorer: 11.0.22621.1

Steps to reproduce

"vue.server.hybridMode": true

update vue.volar to 2.0.20 or 2.0.21


2.0.19 image

2.0.21 image

Link to minimal reproduction

https://github.com/zcf0508/chattts-webui/blob/master/pages/tasks.vue#L42

Any additional comments?

No response

so1ve commented 1 week ago

Could you please try replacing {{ tasks }} with {{ __VLS_ctx }} and then show me the result when you hover over it?

zcf0508 commented 1 week ago

image

timozander commented 1 week ago

+1 having the same issue in a Nuxt app

Type-checking in the script section and regular .ts files works, but the type checking is broken in the Vue template. Specifically, if I hover over variables, I see both - the actual type and any.

Any nested properties then always fallback to any. Downgrading to 2.0.19 also fixes the issue for me.