LoginSignup
1
0

More than 5 years have passed since last update.

vue+typescript+vscodeで「Experimental support for decorators…」のエラーを直す

Posted at

TL;DR

tsconfig.json
{
  "compilerOptions": {
    "experimentalDecorators": true
  }
}

ワークスペースのトップディレクトリに上記のファイルを追加しvscodeを再起動する。

原因

vue+typescriptで開発していると以下のようなエラーが発生する時があります。

0206.png

発生するとしないときがあり、鬱陶しかったので調べたところ、ワークスペースのトップディレクトリのtsconfig.jsonのcompilerOptions.experimentalDecoratorsがtrueではないことが原因らしいです。

vue-cliではなく、parcelで開発していても発生するかもしれません。(tsconfig.jsonが自動生成されないため)

参考

1
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
1
0