# SyntaxError: Invalid or unexpected token

**Code:** `invalid token` · **Category:** JavaScript · **Seen on:** JavaScript

The code contains a character the parser can’t handle — smart quotes, stray characters or an unterminated string.

## Meaning

Copy-pasting code from documents or chat replaces ' and " with curly quotes. Unterminated strings across lines and zero-width characters also trigger it.

## Common causes

- Smart/curly quotes from Word, PDFs or chat
- Unterminated string literal
- Invisible zero-width or non-breaking space characters

## Quick fix

1. Retype the quotes
2. Use template literals for multi-line strings
3. Reveal invisible characters in your editor

## Detailed fix by platform

### JavaScript

1. Search for [“”‘’] and replace with straight quotes

## How to diagnose

1. **Character** — What is at the column reported?
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-invalid-or-unexpected-token)
