-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Generic components throw errors #8171
Comments
This seems to be a regression in Volar when paired with 3.2.x - /cc @johnsoncodehk |
The author's description of the problem is not very clear, when he actually reproduced the problem, he did not run |
@yyx990803 Full error description: X [ERROR] Unexpected ","
NOTE: I also tried updating |
@johnsoncodehk I noticed possibly related stuff in language-tools updates (1.6.2, 1.6.3) that came since reporting this issue. Now it sometimes works, sometimes doesnt. The weirdest thing is that the website runs perfectly whether the error occurs or not. I will try to find out why the error sometimes occurs and sometimes doesnt. Just a little bit stressed that this issue was closed right away and not reopened. The repro project is sound. EDIT: New observation: |
I guess this is related to reported issue: vitejs/vite-plugin-vue#162 |
…s ">" The case occurs with Vue 3 generics usage but is technically possible in other scenarios as well ref: vuejs/core#8171
This error is upstream in Vite core - I've created a fix PR at vitejs/vite#13101 |
Vue version
3.2.47
Link to minimal reproduction
https://github.com/vuejs/language-tools/files/11343091/vue-project.zip
Steps to reproduce
NOTE: The repro project is based on 'npm init vue@latest' from today. All I changed after was updating vue-tsc package from 1.2.0 to 1.6.0. Then I added the important repro generic component called CList.
The errors are thrown only when using < or > chars inside the generic attribute.
If you try replacing
generic="TItem extends Item<TValue>, TValue"
withgeneric="TItem extends SimpleItem"
inside the CList component then the errors disappear.What is expected?
No error to be thrown. This was previously working.
What is actually happening?
My generic components started throwing errors like "Unexpected ","" or "Unterminated string literal" after the Volar extension and vue-tsc package 1.6.0 update (at least I believe this was the trigger).
After consulting Volar language-tools repo I was redirected here.
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: