- Error
- Reported by the lexer and parser
TS1110
Type expected.
The parser expected a type here but found something else, for example after `:` in an annotation or inside type arguments.
What it means
After : in an annotation, after as, inside <...> type arguments and in a type alias, a type is required. This is reported when that position is empty or holds a token that can't start a type.
Example
let value: = 1;
export {};
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(1,12): error TS1110: Type expected.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Write the type:
let value: number = 1;. - If you want the type inferred, remove the
:as well.