Common causes
1. A new line added without a comma before it
Adding a property after the last one is easy to do without putting a comma on the line above. PasteKit reports it as “Missing comma after line N”, pointing at the line that needs it.
{
"name": "Ada"
"email": "[email protected]"
}{
"name": "Ada",
"email": "[email protected]"
}2. Array items separated by spaces or newlines
Lists written one item per line, or copied from a spreadsheet column, often lack commas. Every item except the last needs one.
{"tags": ["admin" "beta" "early-access"]}{"tags": ["admin", "beta", "early-access"]}3. Objects in an array written back to back
Concatenating records produces }{ or } followed by { on the next line. Separate them with commas inside the array.
[
{"id": 1}
{"id": 2}
][
{"id": 1},
{"id": 2}
]4. An unescaped double quote inside a string
In "The "Pro" plan" the quote before Pro closes the string, so the parser sees a finished value followed by the word Pro. Escape inner quotes as \".
{"plan": "The "Pro" plan", "price": 49}{"plan": "The \"Pro\" plan", "price": 49}Frequently asked questions
Why is the error reported on the line after the missing comma?
The parser only knows a comma is missing when it reaches the next value, so the position is the start of that value. Look at the end of the previous line.
What did older browsers say for this error?
Before Chrome 117 and Node 20, V8 reported “Unexpected string in JSON” or “Unexpected number in JSON”, naming the type of the value that appeared where a comma should be.
Can Fix it insert missing commas?
Yes, between properties, array items and adjacent objects. It cannot always tell an unescaped quote from a missing comma, so check the diff when a string contains quotes.