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

fix: extends types to vue instead of @vue/runtime-core #638

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

wenfangdu
Copy link
Contributor

@wenfangdu wenfangdu commented Jun 3, 2023

Description

Since many projects don't have @vue/runtime-core installed (pnpm projects in particular), the types generated by unplugin-vue-components won't work. Vue projects do have vue installed and augmenting vue itself is enough to get the types to work with Volar.

Linked Issues

Fixes vuejs/language-tools#3107
Fixes #355
Fixes #635

@antfu antfu changed the title fix: types aren't working when @vue/runtime-core is not installed fix: extends types to vue instead of @vue/runtime-core Jun 5, 2023
@antfu antfu merged commit efe0a87 into unplugin:main Jun 5, 2023
@lishaobos
Copy link
Contributor

regression: #640

@kevinvalk
Copy link

kevinvalk commented Aug 22, 2023

This indeed prevents types from properly showing up in my setup (quite standard, Vue3, up to date Vue language extensions, TS5 but just like #640 I am also using unplugin-auto-import). https://github.com/vuejs/router even has a TODO in their code asking why it is not working with 'vue' (I do not have the answer).
https://github.com/vuejs/router/blob/c396d14b57be0da1e3504856e89d282f0666242f/packages/router/src/globalExtensions.ts#L11-L12

Solution so far as to lock to version "0.25.0".

@elvisWEB
Copy link

This indeed prevents types from properly showing up in my setup (quite standard, Vue3, up to date Vue language extensions, TS5 but just like #640 I am also using unplugin-auto-import). https://github.com/vuejs/router even has a TODO in their code asking why it is not working with 'vue' (I do not have the answer). https://github.com/vuejs/router/blob/c396d14b57be0da1e3504856e89d282f0666242f/packages/router/src/globalExtensions.ts#L11-L12

Solution so far as to lock to version "0.25.0".

I also encountered the same problem, which took me a lot of time to troubleshoot. I suggest adding an option to control whether to use 'vue' or '@vue/runtime-core'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants