Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hrynevychroman opened this issue Jun 21, 2024 · 3 comments · Fixed by #4492
Closed

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

hrynevychroman opened this issue Jun 21, 2024 · 3 comments · Fixed by #4492
Labels
bug Something isn't working

Comments

@hrynevychroman
Copy link

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
Copy link
Collaborator

davidmatter commented Jun 21, 2024

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

  • Typedefs of certain components won't be written (haven't figured out the underlying reason yet)
  • Syntax highlight is broken (imported components are marked as unrecognized)

Steps to reproduce

  • pnpm create vite@latest
  • pnpm update
  • Point TS version to workspace
  • Create files and restart LSP:

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.

@hrynevychroman
Copy link
Author

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: microsoft/TypeScript#58960

@so1ve
Copy link
Member

so1ve commented Jun 22, 2024

True, please pin typescript to v5.4 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants