vuejs / language-tools

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

Vue-tsc errors after updating to Typescript v5.5.2 #4487

Closed romanhrynevych closed 1 week ago

romanhrynevych commented 1 week ago

Vue - Official extension or vue-tsc version

2.0.21

VSCode version

1.90.2

Vue version

3.4.29

TypeScript version

5.5.2

System Info

System:
    OS: macOS 14.5
    CPU: (12) arm64 Apple M2 Pro
    Memory: 38.67 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 9.4.0 - ~/.nvm/versions/node/v20.11.0/bin/pnpm
  Browsers:
    Chrome: 126.0.6478.114
    Safari: 17.5

Steps to reproduce

defineEmits stopped typing after updating to typescript v5.5.2

image

I think just create component with defineEmits and you must see an issue.

Link to minimal reproduction

No response

Any additional comments?

Interesting that inside VSCode defineEmits are shown by Vue Official (version v2.1.0-insiders.13) 🤔

image

Component is shadcn-vue PinInput

Error only received after vue-tsc --noEmit script running on simple-git-hooks pre-commit

When making reproduction everything works fine with simple components, maybe issue inside Radix library, I don't know 🫠

davidmatter commented 1 week ago

Confirmed, there is an issue with vue-tsc when upgrading to typescript@5.5.2. Same happens when you install 5.5.2 and use the workspace's typescript version rather than the one from vscode:

image

Issues

Steps to reproduce

App.vue

<template>
    <HelloWorld msg="asdf" />
</template>

<script setup lang="ts">
import HelloWorld from './HelloWorld.vue'
</script>

HelloWorld.vue

<script setup lang="ts" >
defineProps<{ msg: string }>()
</script>

<template>
  <div></div>
</template>

Workaround

Make sure to pin your typescript dependency to ~5.4.0 and to use the typescript version shipped with vscode.

romanhrynevych commented 1 week ago

UPD: yeah, when change VS Code version of typescript to workspace v5.5.2, error shows in editor too

image image

Maybe this is somehow related to: https://github.com/microsoft/TypeScript/issues/58960

so1ve commented 1 week ago

True, please pin typescript to v5.4 for now