language-tools: With vue-i18n it gives types error of $t and $i18n usage

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.

volar-html

What am i missing here?

About this issue

  • Original URL
  • State: open
  • Created 7 months ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

In Home.vue with just simple usage it’s reproducible.

Provide a repo that reproduces. It’s relevant how the project is set up. The specific component you are showing is not enough. And if vue-i18n itself doesn’t extend Vue types then it would be your responsibility to do that, not Volar’s.

It might be a better question for the vue-i18n repo, to be honest.

We should wait for reproduction instead of investigating as there were known issues with types in i18n nuxt module that might be fixed already.

There were issues with types unrelated to Volar, as the linked issue states. Please provide a repo that reproduces and also make sure you are using latest versions of the module.