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
- Check the line before the error
- Run a linter/formatter
- Use type="module" for import statements
Detailed fix by platform
JavaScript
- Prettier or ESLint pinpoints the missing punctuation instantly
How to diagnose
- Line — The reported line and the one above
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026