TS1005: ';' expected / ',' expected (syntax error) TypeScript Origin: On your device Last updated 5 Nov 2026

TypeScript: error TS1005: ';' expected.

The parser hit a syntax error — missing punctuation, mismatched brackets, or an unsupported syntax for your TypeScript version.

Exact message you may see error TS1005: ';' expected.error TS1005: ',' expected.error TS1005: '}' expected.error TS1005: ')' expected.TS1005 expected
Seen on: TypeScript

Meaning

Look at the reported line and the line before it: missing comma/semicolon/brace, unclosed template string or JSX tag, => in the wrong spot, or newer syntax (satisfies, accessor, decorators) on an older TypeScript. Update TypeScript (npx tsc -v) and your editor's TS version.

Common causes

  • Missing/extra bracket, comma or semicolon
  • Unclosed string/template/JSX
  • Newer syntax with an old compiler (satisfies, enum const)
  • Pasted smart quotes
  • Wrong file type (JSX in .ts)

⚡ Quick fix

  1. Fix the syntax at/above the line
  2. Upgrade TypeScript (npm i -D typescript@latest)
  3. Use .tsx for JSX; replace smart quotes

Detailed fix by platform

Linux

  1. npx tsc -v && npx tsc --noEmit | head

How to diagnose

  1. Line — Previous line OK?
  2. TS version — Supports syntax?
  3. File — .tsx for JSX?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Adjacent JSX elements — Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (React)Adjacent JSX elementsalready declared — SyntaxError: Identifier 'x' has already been declared (JavaScript)already declaredawait outside async — SyntaxError: await is only valid in async functions and the top level bodies of modules (JavaScript)await outside asyncCannot find module './App.vue' or its corresponding type declarations — TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations. (Vue)Cannot find module '.…Element is missing end tag — Vue: [plugin:vite:vue] Element is missing end tag. / Invalid end tag. (Vue)Element is missing en…ERR_UNKNOWN_FILE_EXTENSION — TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" (Node.js)ERR_UNKNOWN_FILE_EXTE…ESLint Parsing error in .vue files — ESLint: Parsing error: Unexpected token < / Parsing error: '>' expected (vue-eslint-parser not configured) (Vue)ESLint Parsing error …invalid regex — SyntaxError: Invalid regular expression: /x/: Unterminated group (JavaScript)invalid regexTS1005: '…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.