Skip to content

JSONMissingBlock false positive for app block when section supports both @app and @theme #1144

Description

@matylda-commerce-ui

if (blockType === '@theme' || blockType === '@app') {

Describe the bug
When a section schema allows both @app and @theme blocks, Theme Check reports JSONMissingBlock for valid app block types in product.json.
It tries to resolve the app block URI as a local theme block file (... .liquid), which is incorrect.

Source
When having blocks defined in section defined like below

blocks: [{ type: '@app' }, { type: '@theme' }],

allows us to add two different types of blocks. This can result in structure like below in product.json

"main": {
      "type": "main-product",
      "blocks": {
        "some_app_block": {
          "type": "shopify://apps/some_app_block/....",
        }
      },

which will generate a false error

[error]: JSONMissingBlock
Theme block 'blocks/shopify://apps/some_app_block/.....liquid' does not exist.

Expected behaviour
App block URIs (shopify://apps/...) should be treated as valid when section schema includes @app, even if same section also includes @theme.

Actual behaviour
Theme Check raises JSONMissingBlock and treats the app block URI as a missing local theme block file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions