# SyntaxError: Unexpected identifier

**Code:** `unexpected identifier` · **Category:** JavaScript · **Seen on:** JavaScript

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

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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/javascript/syntaxerror-unexpected-identifier)
