Skip to content

Liquid (Shopify): editor JSON comments and section groups break dependency chains #2494

Closed

Description

@Puma7

Shopify editor-saved JSON templates lose section dependencies, plural sections tags are missed, and schema examples inside Liquid comments become active definitions. Reproduced on v1.6.2 and source main fc0da38f.

Minimal examples:

// templates/product.json; sections/main-product.liquid exists
/* Generated by the Shopify editor */
{"sections":{"main":{"type":"main-product"}},"order":["main"]}

Expected: a file reference to sections/main-product.liquid at the type value. Actual: none; strict JSON parsing rejects the editor comment. Without the comment, the target is found but its position is reported as line 1.

{% sections 'header-group' %}
{% comment %}{% schema %}{"name":"Ghost"}{% endschema %}{% endcomment %}

Expected: a dependency on sections/header-group.json and no Ghost definition. Actual: the dependency is absent and Ghost is indexed. raw blocks have the same false-definition problem; the plural tag is also missed inside multiline liquid.

The directories and section tags are Shopify conventions; comment/raw suppression is standard Liquid. This is not a proposal to apply Shopify paths to Jekyll. Missing dependencies can make impact/dependents queries omit real consumers.

Draft #2496 uses the existing JSONC parser, preserves source positions and shares the comment/raw scanner. Its 26 regressions pass; the original unpatched base failed 13 and passed 13 controls. Syntax validation does not imply full Shopify schema validation.

References: JSON templates, section groups, comment/raw.

Activity

  1. changed the title [-]Liquid: editor JSON comments and section groups break Shopify dependency chains[/-] [+]Liquid (Shopify): editor JSON comments and section groups break dependency chains[/+] on Oct 11, 2026
  2. Puma7 commented on Oct 12, 2026

    @Puma7
    Author

    Updated validation after the supplied review:

    The schema counterexample remains valid; #2496 now reuses the comment/raw scanner and passes all 26 dedicated regressions against current upstream. The issue body has been shortened to reproduction, impact and scope.

  3. colbymchenry commented on Oct 22, 2026

    @colbymchenry
    Owner

    Thanks for the clear report and for #2496, which this fix follows closely.

    #2812 is merged to main and fixes all three parts:

    • Templates and section groups saved by the theme editor now link the sections they list, each from the line that names it.
    • A layout's {% sections 'header-group' %} tag links to its section group.
    • A schema inside {% comment %} or {% raw %} is no longer indexed.

    One difference from your PR: trailing commas are accepted too, since Shopify's docs and theme-check both accept them in theme JSON. It ships in the next release (the latest is 1.6.2), and re-indexing a theme then picks up the new links.

  4. added a commit that references this issue on Oct 22, 2026
    efb091e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions