0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Nuxt] エラー「Property '$axios' does not exist on type 'CombinedVueInstance'」が発生する

Posted at

エラーについて

Nuxt で@nuxtjs/axios を使用したときに、TSのエラーが発生した

Property '$axios' does not exist on type 'CombinedVueInstance ...

動作環境

package.json
{
  "dependencies": {
    "@nuxt/types": "^2.15.8",
    "@nuxtjs/axios": "^5.13.6",
    "@types/google.maps": "^3.47.2",
    "nuxt": "^2.15.8",
    "typescript": "^4.5.4"
  },
}

解消方法

tsconfig.json@nuxtjs/axios の型を指定できていなかったことが原因
types に必要な型の指定を追加する

tsconfig.json
{
  "compilerOptions": {
    "types": [
      "@types/node",
      "@nuxt/types",
      "@nuxtjs/axios", // 型を追加
      "@types/google.maps",
    ]
  }
}
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?