0
1

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 3 years have passed since last update.

TypeScriptのデコレータエラー

Posted at

Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.というエラーが出たときの対処したこと

tsconfigかjsconfigの中にあるexperimentalDecoratorsを設定して。と言われていますね。そのため、tsconfig.jsonの中の

"experimentalDecorators": true,  

のコメントアウトを解除しました。
しかし、エラーが消えません。そこで、私がしたことをお伝えします。

VScodeを設定する

・設定→ワークスペースのJS/TS Inplicit Project Config: Experimental Decoratorsにチェックを入れる→再起動

スクリーンショット (53).png

検索欄にexperimentと入力すると出てきます。

ちなみに、tsconfig.jsonにあるallowJsやemitDecoratorMetadataのコメントアウトを外して有効にするという記事もあったのですが、調べてみたところ、allowJSは、jsファイルやjsxファイルのコンパイルを可能にする設定、emitDecoratorMetadataはmetadataを使えるようにするための設定とあったので、関係ないのかなと思ってしまいました。(初学者すぎるので違うかもしれません。)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?