unexpected identifier 🟨 JavaScript

SyntaxError: Unexpected identifier

The parser found a name where it expected punctuation — usually a missing comma, operator or quote.

Seen on: JavaScript

Meaning

Missing commas in object literals/arrays, a missing + between strings, or using import in a non-module script all produce it.

Common causes

  • Missing comma between object properties
  • Missing operator between values
  • import/export in a classic script
  • Unquoted string

⚡ Quick fix

  1. Check the line before the error
  2. Run a linter/formatter
  3. Use type="module" for import statements

Detailed fix by platform

JavaScript

  1. Prettier or ESLint pinpoints the missing punctuation instantly

How to diagnose

  1. Line — The reported line and the one above
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 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.