You paste a custom section into Shopify, click Save, and receive Invalid JSON in tag ‘schema’ or Invalid JSON: unexpected token. The Liquid above the schema can be valid; Shopify is rejecting the JSON inside the schema block.
The likely cause
Shopify section schema must be strict JSON. Strict JSON does not allow comments, smart quotation marks, trailing commas, duplicate top-level fragments, or unescaped quotation marks inside strings.
Confirmed Community fixes
Community examples repeatedly resolve these errors by removing trailing commas, replacing curly quotes, escaping quotation marks inside string values, deleting duplicate schema fragments, and removing comments.
Minimal valid schema
{% schema %}
{
"name": "Example section",
"settings": [],
"presets": [
{ "name": "Example section" }
]
}
{% endschema %}
Common fixes
- Replace smart quotes with straight ASCII quotes.
- Remove trailing commas.
- Remove
//and/* */comments. - Escape embedded quotes inside strings.
- Keep only one schema block per section file.
- Confirm setting IDs are unique and defaults match their data types.

