-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
With vue-i18n it gives types error of $t and $i18n usage #3760
Comments
It might be related to this I am not sure tough. |
the same issue #3735 |
There were issues with types unrelated to Volar, as the linked issue states. |
Duplicate of #3735 |
I'm not sure if those are duplicates. One is using nuxt module and one is using (older) version of vue-i18n |
Sorry, didn't notice that 😅 I'll reopen this issue to investigate further |
We should wait for reproduction instead of investigating as there were known issues with types in i18n nuxt module that might be fixed already. |
So I added the |
I am using Vue 3. Not nuxt. |
The issue mentioned in that comment was caused by Vue i18n which nuxt i18n does also use under the hood. |
Using below versions.
In
This is nothing related to |
Provide a repo that reproduces. It might be a better question for the |
If error highlights without this extension then it would be |
No, just a snippet of code is not enough. It's also relevant which packages are installed and in what versions. And the Just create a project that reproduces and put it on stackblitz or github. Then someone can download it locally and check with Volar. |
Because I have a monorepo with [email protected] installed, and the main version I use is [email protected]. The package '@vue/runtime-core' under the root node_modules belongs to 3.2.47, and 'vue/node_modules' /@vue/runtime-core' is what 3.3.4 actually uses. So the type definition of vue-i18n does not take effect |
I don't know how to configure npm workspace to force installing sub package's vue inside their respective node_modules, so I just remove workspaces config in the root package.json and run npm install then add the config back and run npm install -w packages/*, once the "@vue/runtime-core" version under root project is ok, the issue will be gone. |
As soon as i enable/install
Vue Language Features (Volar)
in VS code, i get type errors in html wherever$t
and$i18n
is used.<template> <h1>{{ $t('views.home.title') }}</h1> <h1>{{ $i18n.locale }}</h1> </template>
Above is my html.
And below is how i get errors/warnings by volar.
What am i missing here?
The text was updated successfully, but these errors were encountered: