Skip to content

[Bug]: JSONMissingBlock error not reported #6072

@NathanPJF

Description

@NathanPJF

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

If I change the nested blocks in a private, static block, and one of the block types is not allowed, I should see a JSONMissingBlock warning / error.

Running shopify theme check should include the problematic template

Example from https://github.com/Shopify/horizon/pull/5153

/* templates.404.json */

"static-product-card": {
    "type": "_product-card",
    "name": "t:names.product_card",
    "static": true,
    "settings": {},
    "blocks": {
      "group_BG77MP": {
        "type": "group", /* <-- not an allowed block type */
        "name": "t:names.group",
        "settings": {}
      }
}

Actual behavior

I'm not getting any warning or report from Theme Check on CI or running shopify theme check

However, the VS code extension does correctly tell me about the error

Image

Verbose output

Text ouput too large so I've compressed the txt file.

theme-check-output.txt.zip

Reproduction steps

Shopify employees

  1. Go to https://github.com/Shopify/horizon/pull/51532 and checkout the branch locally. Run shopify theme check
  2. See that the CI run ci.yml runs shopify/theme-check-action@v2, and there is no mention of this error in the report

General reproduction steps:

  1. Create a private block, and specify what blocks it can take

Example: blocks/_product-card.liquid

{% schema %}
{
  "name": "t:names.product_card",
  "blocks": [
    {
      "type": "_product-card-group"
    },
  ],
  "settings": [...],
  1. Include it as a static block in a template file, like 404.json
 {
  "sections": {
    "product_list": {
      "type": "product-list",
      "blocks": {
        "static-product-card": {
          "type": "_product-card",
          "name": "t:names.product_card",
          "static": true,
          "settings": {},
          "blocks": {
            "product_card_group": {
              "type": "group",
              "name": "t:names.group",
              "settings": {},
            },
          "block_order": [
            "product_card_group"
          ]
        }
      },
    }
  },
  "order": [
    "product_list",
  ]
}

Operating System

Mac OS

Shopify CLI version (shopify --version)

@shopify/cli/3.81.2 darwin-arm64 node-v22.14.0

Shell

zsh

Node version (run node -v if you're not sure)

v22.14.0

What language and version are you using in your application?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions