LoginSignup
0
0

More than 3 years have passed since last update.

Typescriptを使ってないプロジェクトでVeturのtemplate内での型推論の警告(Vetur2339)が出てしまう問題への対処法

Posted at

症状

vscodeを使っていて、Vueプロジェクトでいつからか急にtemplate内で型への警告が出るようになりました。
Typescriptを導入しているプロジェクトではなく、型への警告を出されてもちょっと困るなあと思っていました。
以下のように怒られます。


Property '$store' does not exist on type 'CombinedVueInstance<Record<never, any> & Vue, object, object, object, Record<never, any>>'.Vetur(2339)

対応

どうやら、原因はVueを書くなら誰もが入れるであろうvscode拡張機能のVeturのtemplate内での型推論機能が働いているようでした。
そこでvscodeの設定のsettings.json内で以下のようにすることで型推論の警告が出なくなりました。

settings.json
{
  "vetur.experimental.templateInterpolationService": false,
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0