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

When using [email protected] + @vue/composition-api, Volar cannot recognize custom components. #3738

Closed
curlykay opened this issue Nov 17, 2023 · 12 comments
Labels
vue2 Issues that concern vue2

Comments

@curlykay
Copy link

Reproduction: https://github.com/curlykay/volar-test.git

environment
macos 13.4.1
vscode 1.84.2
vue 2.6.14
volar 1.8.23
@vue/composition-api 1.7.2

The minimal repo built with @vue/cli (Vue + TypeScript), using Volar in 'takeover mode'.
image
image

I followed the steps in 'Setup for Vue 2' from https://marketplace.visualstudio.com/items?itemName=Vue.volar completely to set up the repository. I added "@vue/composition-api" and developed components using defineComponent. However, after restarting VSCode, Volar recognizes the component as '(property) HelloWorld: unknown'.
image
Do I need to add anything else?

@so1ve
Copy link
Member

so1ve commented Nov 17, 2023

Maybe vue 2.6 should stay on Vetur...?

@rchl
Copy link
Collaborator

rchl commented Nov 17, 2023

Is there are reason that you are not using Vue 2.7?

@curlykay
Copy link
Author

Maybe vue 2.6 should stay on Vetur...?

Vetur does not support TS 5.0, and that's been my frustration.vuejs/vetur#3689 (comment)

@curlykay
Copy link
Author

curlykay commented Nov 17, 2023

Is there are reason that you are not using Vue 2.7?

I plan to upgrade to Vue 2.7, but some parts of vue-property-decorator are incompatible with Vue 2.7 kaorun343/vue-property-decorator#451 (comment). So, I intend to use 'Vue 2.6' with '@vue/composition-api' as an interim solution. This way, I can continue working with the Composition API while addressing compatibility issues and transitioning to Vue 2.7.

@curlykay
Copy link
Author

I might have been a bit eager, and for that, I apologize. However, the responses I've received seem to lack clarity.
So, did I do something wrong, or does Volar indeed not support intelligent prompt for components with this combination ('[email protected]' + '@vue/composition-api')?

@so1ve
Copy link
Member

so1ve commented Nov 17, 2023

I do think so - Volar only supports Vue 2.7+ and 3.0+, otherwise you should use Vetur. Vetur's support for TS 5.0 is a Vetur issue, not Volar's.

@curlykay
Copy link
Author

curlykay commented Nov 17, 2023

Thank you for your response. The mention of Vetur's incompatibility with TS 5.0 was just to explain why I want use volar for [email protected]. If it caused you any inconvenience, I apologize.
Perhaps the VSCode Marketplace description for Vue 2 compatibility operations needs to specify its relevance for [email protected], to prevent further confusion among users like me.
image
Volar is a magnificent creation. Thank you for your dedication.

@zhangyahan
Copy link

zhangyahan commented Dec 24, 2023

@curlykay This is a bit strange. I am using Vue:>=2.6.14<2.7 and @ Vue/composition app: ^ 1.7.2 and Volar: v1.8.26, which are currently working normally.
image
Are you missing a certain configuration?

@curlykay
Copy link
Author

这有点奇怪。我正在使用 Vue:>=2.6.14<2.7 和 @ Vue/composition app: ^ 1.7.2 和 Volar: v1.8.26,它们目前工作正常。 图像您是否缺少某个配置?

Could you please give me a repo? This is my repo: https://github.com/curlykay/volar-test.git, I reconfirmed that there is no display prompt.

@zhangyahan
Copy link

@curlykay I don't know why, this project is also in the same situation in my pc. I have switched from Volar to Vetur due to some issues. Because I understand a truth that when something is difficult at the beginning, it must be choosing the wrong direction.

@curlykay
Copy link
Author

@zhangyahan I also switched back to Vetur, but when I upgrade Vue to Vue2.7+ in the project, I will continue to try Volar. Its Template Intelligence Sensing is the feature I need.

@davidmatter
Copy link
Collaborator

Please check if this issue has been resolved in version 2.x. If not, feel free to create a new one.

@davidmatter davidmatter closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2024
@davidmatter davidmatter added the vue2 Issues that concern vue2 label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue2 Issues that concern vue2
Projects
None yet
Development

No branches or pull requests

5 participants