Loading...
Loading...
SyntaxError: Unexpected token ' in JSON at position 1The JSON standard requires double quotes (") for strings and property names. Using single quotes (') is common in JavaScript but strictly forbidden in JSON.
Replace all single quotes used as delimiters with double quotes.
// ❌ Invalid
{ 'id': 1, 'name': 'test' }
// ✅ Valid
{ "id": 1, "name": "test" }Let JavaScript handle the quoting rules for you.
// ❌ Error-prone manual string
const json = "{ 'name': 'bob' }";
// ✅ Safe automatic string
const json = JSON.stringify({ name: 'bob' });