vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 404 forks source link

No error messages in template section #1441

Closed Leon0402 closed 2 years ago

Leon0402 commented 2 years ago

I use https://github.com/johnsoncodehk/volar-starter to be sure to not have misconfigured anything and installed the normal volar & volar ts vs code extensions.

In general, there are no error messages about missing imports for components. For instance:

image

No error message about the missing HelloWorld import.

And if I don't use lang="ts" there are no error messages at all anymore. See the same example:

image

No error message about the missing prop.

johnsoncodehk commented 2 years ago

Duplicate of #844

Leon0402 commented 2 years ago

@johnsoncodehk I don't understand why this is a duplicate?

In the explanation you mention that the extension is not able to show errors, which are a result of the wrong type. This make sense, because javascript doesn't have these types. But in my explample, a prop is just missing and there is no error message for it. What is the explanation for this?

johnsoncodehk commented 2 years ago

@Leon0402 You should config checkJs in tsconfig / jsconfig to enable type-checking for lang="js".

Leon0402 commented 2 years ago

@Leon0402 You should config checkJs in tsconfig / jsconfig to enable type-checking for lang="js".

Thanks this worked! It still doesn't find missing imports in the template section, but this seems to be true for typescript as well. I assume this is a different issue

johnsoncodehk commented 2 years ago

@Leon0402 if you're using @vue/composition-api, see https://github.com/johnsoncodehk/volar/issues/1350.

AdrianFahrbach commented 5 months ago

I think I got the same issue: screenshot 2024-06-26 at 18 46 01@2x ~Shouldn't test show an error here since it is not defined anywhere? I'm only using the Vue - Official plugin.~

Nevermind! The issue was related to a styled-components plugin that broke the Vue plugins hybrid mode. I forcefully enabled it, because I thought the styled-components plugin was limited to React and therefore probably a false positive. Everything is working fine now again.