技術向上

プログラミングの学び、気になるテクノロジーやビジネストレンドを発信

エラー解消法_Property '…' has no initializer and is not definitely assigned in the constructor【TypeScript】

TypeScriptで、Property '…' has no initializer and is not definitely assigned in the constructorのエラー、つまり初期化されていない、というエラーが発生する場合、tsconfig.jsonに下記を記述をするとエラーが解消されます。

"strictPropertyInitialization": false


プロパティの初期化チェックの厳密でなくする、という設定を意味します。