Skip to content
Latchkey

TS1005: ';' expected (or other token) - in CI

tsc hit a syntax error: a token it required (a semicolon, comma, paren, or bracket) is missing.

What this error means

Type-checking fails with TS1005 stating which token was expected at a specific position.

tsc
src/parse.ts(12,18): error TS1005: ',' expected.

Common causes

How to fix it

Fix the syntax at the reported position

  1. Go to the file/line/column and correct the missing or stray token

Use the right extension for JSX

  1. Rename files containing JSX to .tsx so the parser enables JSX
shell
mv src/Card.ts src/Card.tsx

How to prevent it

  • Run tsc --noEmit and a formatter in CI to catch syntax errors, and keep JSX in .tsx files.

Frequently asked questions

What causes "TS1005 expected token"?
Type-checking fails with TS1005 stating which token was expected at a specific position.
How do I fix TS1005 expected token?
Fix the syntax at the reported position

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card