JSONMissingBlock false positive for app block when section supports both @app and @theme
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/theme-check-common/src/checks/json-missing-block/missing-block-utils.ts at line 31 and trace how block URIs are resolved when a section supports both @app and @theme. Verify that shopify://apps/... URIs are accepted as app blocks while missing local theme block files still report errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100