TypeScriptのエラー一覧と解決方法(20件)
実在のTypeScriptエラーメッセージを収録。各ページで原因と直し方を日本語で解説しています。
- TS2307: Cannot find module 'react' or its corresponding type declarations.
- TS2322: Type 'string' is not assignable to type 'number'.
- TS2531: Object is possibly 'null'.
- TS18048: 'value' is possibly 'undefined'.
- TS7006: Parameter 'x' implicitly has an 'any' type.
- TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'.
- TS2304: Cannot find name 'process'.
- TS1259: Module can only be default-imported using the 'esModuleInterop' flag
- TS2580: Cannot find name 'require'.
- TS2769: No overload matches this call.
- TS2366: Function lacks ending return statement and return type does not include 'undefined
- TS2451: Cannot redeclare block-scoped variable 'x'.
- TS6133: 'x' is declared but its value is never read.
- TS2741: Property 'x' is missing in type but required in type
- TS2589: Type instantiation is excessively deep and possibly infinite.
- TS1192: Module '"x"' has no default export.
- TS5023: Unknown compiler option
- TS2786: 'Component' cannot be used as a JSX component.
- TS2459: Module 'x' declares 'Y' locally, but it is not exported.
- TS2693: 'X' only refers to a type, but is being used as a value here.
エラー文を貼って探すならエラーメッセージ検索ツールが便利です。