Why it happens
The position points at the first character after the value, here the quote that opens "queue" on line 4. The mistake sits just before it. Most common causes first:
1. A missing comma between properties. A line added to a config file by hand, or a block pasted from docs: in the sample, "port": 8080 has no comma. npm reports the same problem in a broken package.json:
npm error code EJSONPARSE
npm error JSON.parse Invalid package.json: JSONParseError: Expected ',' or '}' after property value in JSON at position 53 (line 4 column 3) while parsing near "...version\": \"1.0.0\"\n \"private\": true\n}\n"
2. A double quote inside a string. In {"note": "Customer said "call after 5""} the string ends after said , and the parser finds c where a comma should be. This comes from building JSON by hand, for example with a template literal: `{"note": "${note}"}`.
3. A comment after a value. "port": 8080 // dev only fails at the /. JSON has no comment syntax; see Comments are not permitted in JSON.
4. A value JSON cannot read to the end. "timeout": 30s stops after 30, and hex like 0xFF stops after the 0. JSON numbers are plain decimals, so write 30 or the string "30s".
How to fix Expected ‘,’ or ‘}’ after property value
Put the comma after the previous value
Take the line and column from the message and step back to the end of the value before it. For the sample, line 4 column 3 means the comma goes after 8080 on line 3. The JSON validator marks that spot directly with Missing comma between properties.
Build JSON with a serializer
const note = 'Customer said "call after 5"';
const body = JSON.stringify({ note }); // {"note":"Customer said \"call after 5\""}
In Python, json.dumps({"note": note}) escapes the quotes the same way.
Let Repair add what is missing
JSON Repair adds the comma in the sample, escapes the inner quotes in the note example, strips comments and turns 30s into the string "30s". Read the result before you save it: Repair guesses at intent.
Same error in other languages
- Python:
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 3 (char 47) - Go:
invalid character '"' after object key:value pair - PHP:
json_decode()returnsnull, andjson_last_error_msg()saysSyntax error. - VS Code:
Expected comma(514) under the key that follows the missing comma. - Node.js 18:
Unexpected string, or Unexpected number in JSON when a number follows the value.
For other parse errors, see common JSON errors.