読み方のヒント
矢印ボタン(または ← → キー)でページを移動できます。
エラーは、場所・番号・意味の順に書かれています。
src/products.ts:12:5 - error TS2322: Type 'string' is not assignable to type 'number'.
12 price: "220",
~~~~~
| 部分 | 意味 |
|---|---|
src/products.ts:12:5 | ファイル、行、列 |
TS2322 | エラーの番号。検索するときに使う |
Type 'string' is not assignable to type 'number'. | 何が起きたか |
~~~~~ | エラーの場所 |
よく出るエラーの文は、型の名前を入れかえた形がほとんどです。
| エラーの文 | 意味 | よくある原因 |
|---|---|---|
Type 'A' is not assignable to type 'B'. | A を B に入れられない | 値の型と、変数や引数の型が違う |
Property 'x' does not exist on type 'A'. | A に x がない | つづりのまちがい、しぼりこみ忘れ |
'x' is possibly 'undefined'. | x が undefined かもしれない | 確かめずに使っている |
Argument of type 'A' is not assignable to parameter of type 'B'. | 引数の型が違う | 呼び出し方のまちがい |
Expected 2 arguments, but got 1. | 引数の数が違う | 引数の渡し忘れ |
17 / 20