- Error
- Reported by the tsconfig loader
- Reported by the lexer and parser
TS1005
'{0}' expected.
The parser expected a specific token (shown in quotes in the message) and found something else. Usually a missing comma, bracket or semicolon.
What it means
The message names the exact token the parser needed, such as ',', ')', ';' or '}'. It's reported at the place where that token should have been. A missing token earlier in the file can make the parser report this at a later, surprising spot, and one mistake can produce several of these errors in a row: fix the first one first.
Example
const point = { x: 1 y: 2 };
export {};
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(1,22): error TS1005: ',' 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
- Insert the token the message names at the reported position (here a
,between properties). - Check that brackets, parentheses and braces are balanced above the reported line.
- Fix the first syntax error in the file and re-run; later ones are often caused by it.