FormatWell

Guides / JSON errors

Expected double-quoted property name in JSON

How it appears per engine

  • Uncaught SyntaxError: Expected double-quoted property name in JSON at position 8 (Chrome / Node.js)
  • SyntaxError: JSON.parse: expected double-quoted property name at line 1 column 9 of the JSON data (Firefox)

What this error means

After a comma inside an object, the parser expects the next property name in double quotes. The classic trigger is a trailing comma before the closing brace — the comma promises another property that never arrives.

Common causes

1. A trailing comma before }

Trailing commas are fine in modern JavaScript and in JSON5 config files, but the JSON standard (RFC 8259) forbids them.

Fails

{
  "a": 1,
  "b": 2,
}

Works

{
  "a": 1,
  "b": 2
}

2. Keys quoted with the wrong characters

Single quotes, backticks, or “smart quotes” pasted from a chat app or word processor all fail. Only straight double quotes (") are JSON.

Fails

{ “a”: 1 }

Works

{ "a": 1 }

3. A comment where a key should be

JSON has no comments. Tools like tsconfig.json accept them (that is JSONC), which trains people to expect they work everywhere.

How to fix it

  1. Delete the comma after the last property in every object and array.
  2. Replace curly/smart quotes with straight double quotes — re-type them if you pasted from a document.
  3. Strip // and /* */ comments.

Related errors