-
Notifications
You must be signed in to change notification settings - Fork 70
Description
theme-tools/packages/theme-check-common/src/checks/json-missing-block/missing-block-utils.ts
Line 31 in 5612587
| 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.