tsc TS1005: ';' expected (syntax error) in CI
TS1005 is a parser error: tsc reached a point where it expected a token (often ;) and found something else. It commonly means a genuine typo, or that tsc is parsing JSX/TSX as plain TS.
What this error means
tsc fails with "error TS1005: ';' expected." at a specific line and column, sometimes cascading into further syntax errors below it.
tsc
src/App.tsx:6:17 - error TS1005: ';' expected.
6 return <Button>Click</Button>;
~Common causes
A genuine syntax typo
A missing comma, an unclosed bracket, or a stray token leaves tsc expecting a ; where the next token does not fit.
JSX in a file tsc is not parsing as JSX
A .tsx file compiled without "jsx" set, or JSX placed in a .ts file, makes tsc treat <Tag> as a comparison and report a syntax error.
How to fix it
Fix the syntax at the reported position
- Open the exact line and column from the error.
- Correct the missing token or malformed statement.
- Re-run tsc, since one syntax error can mask later ones.
Terminal
// ensure JSX files end in .tsx and jsx is configuredEnable JSX parsing for TSX files
If the error is on JSX, set the jsx option and use the .tsx extension so tsc parses the markup.
tsconfig.json
{
"compilerOptions": { "jsx": "react-jsx" }
}How to prevent it
- Put JSX only in
.tsxfiles and set thejsxoption. - Let the editor flag syntax errors before pushing.
- Run tsc locally so parser errors are caught before CI.
Related guides
tsc TS2451: Cannot redeclare block-scoped variable 'x' in CIFix tsc "error TS2451: Cannot redeclare block-scoped variable 'x'" in CI - a name is declared twice in the sa…
tsc TS2792: Cannot find module 'x'; did you mean to set moduleResolution to nodenext? in CIFix tsc "error TS2792: Cannot find module 'x'. Did you mean to set the 'moduleResolution' option to 'nodenext…
tsc TS5024: Compiler option 'x' requires a value of type ... in CIFix tsc "error TS5024: Compiler option 'x' requires a value of type Y" in CI - a tsconfig option was given th…