language-tools
language-tools copied to clipboard
Property '$t' does not exist on type 'Vue3Instance'
We have a Nuxt2/Vue2 project, but for some reason, in certain components, Volar reports the following error:
Property '$t' does not exist on type 'Vue3Instance<{}, Readonly<ExtractPropTypes<{}>>, Readonly<ExtractPropTypes<{}>>, {}, {}, true, ComponentOptionsBase<any, any, any, any, ... 5 more ..., any>> & ... 4 more ... & Readonly<...>'.ts(2339)
Why is it thinking it should be a Vue3Instance
, when the project is vue 2?
It also doesn't happen everywhere, which is odd.
Weird error:
This seems fine:
Could you please provide a minimal reproduction?
Are you using vue 2.7? The exported type name from vue
package is called Vue3Instance
to tell users its began will be like vue 3, and this doesn't matter.
Did you do this https://i18n.nuxtjs.org/v7/setup#typescript ?
We're not using Typescript and the Volat TS extension is disabled as well, this comes from the Volar Language Server one.
Please provide a minimal reproduction to help debug, thanks!
It doesn't matter if you are using typescript or not you have to configure it as per nuxt-i18n module documentation.
I came across the same error, also with nuxt2, vue2 and no ts.
It only occurs in .vue files without <script>
tags. Even an empty <script></script>
"resolves" the error.
I don't think that counts as a solution or is a <script>
tag a must in .vue files?
Same problem in a Nuxt Bidge app
Closing this one due to lack of a minimal reproduction. If this is still an issue in version 2.x, feel free to create a new issue with a minimal reproduction.