What does "Type must be defined in schema" mean in Shopify?
It means a template (or a section group such as the header) contains a block whose type is not listed in that section's {% schema %}, so Shopify refuses to save the file. Fix it by adding the block type back to the section's blocks array, or by deleting that block from the template file.
The full message reads Invalid value for type in block 'z'. Type must be defined in schema., with the template file named above it. Below is what each part means, the 13 cases we ran on a Shopify development store on 25 October 2026, and the one cause that makes the error appear on a file you have not touched in weeks.
What does each part of the error mean?
| Part | Example | What it tells you |
|---|---|---|
| The file name above the message | templates/index.json or sections/header-group.json | The JSON file that was refused. It is never the .liquid section file itself. |
block 'z' | 'nav_4', 'text_aB3x' | The block's id: the key inside "blocks" in that JSON file. It is not the block type, so do not search the schema for it. |
Type must be defined in schema | (the same every time) | That block's "type" value has no matching entry in the blocks array of the section it belongs to. |
To find the mismatch, open the named JSON file, search for the block id, read its "type", then open the section named by the "type" a few lines above it and look at the blocks list near the bottom of its schema. The two names have to match exactly.
What causes "Type must be defined in schema"?
Every cause we found comes down to a name in the JSON file that the section schema does not contain:
- The block type was never declared. A template uses
"type": "image"but the section only liststext. - The spelling or case differs.
"Text"and"text"are different types. Shopify refused the capitalised one. - The section has no
blocksarray at all, and the template gives it blocks anyway. - The block lives in a section group. Header and footer blocks are stored in files such as
sections/header-group.json, which fail the same way. This is the version we hit ourselves: a generated theme seeded menu link blocks into a header whose schema declared settings but no blocks, and Shopify refused the file withblock 'nav_4'. - The type was removed from the schema after the template was saved. This one does not fail when you make the change. It fails later, and it gets its own section below.
What did Shopify say when we tested it?
We built a small test theme, pushed it to a Shopify development store with Shopify CLI 3.93.1 on 25 October 2026, read every error Shopify returned, pulled the stored files back down, and deleted the theme afterwards. The section declared one block type, text, limited to 2 uses, plus a number setting, a dropdown and a text setting.
| What the template contained | What Shopify did |
|---|---|
A block of type image, not in the schema | Refused: Invalid value for type in block 'z'. Type must be defined in schema. |
A block of type Text (capital T) | Refused: the same message |
Blocks on a section whose schema has no blocks array | Refused: the same message |
| An undeclared block in a header section group file | Refused: the same message, naming the group file |
A block of type @theme on a section that does not accept theme blocks | Refused: the same message |
A block of type @app on a section that does not accept app blocks | Refused with a different ending: Block type must be an app block path. |
A block with no "type" key | Refused: Block id 'z' missing a type field. |
3 text blocks where the schema says "limit": 2 | Refused: Block type 'text' cannot be used more than 2 times. |
The word abc in a number (range) setting | Refused: Setting 'size' must be a valid number |
center in a dropdown whose only options are left and right | Accepted, and stored as center unchanged |
| Setting ids the schema does not have | Accepted, and the unknown settings were quietly deleted from the stored file |
A block id in block_order that does not exist | Accepted, and the missing id was quietly deleted |
| Removing a block type from the schema while a saved template still uses it | Accepted. The error came later (see below) |
One refused file did not stop the rest. Shopify still created the theme, uploaded every valid file, and reported the theme as pushed with errors. The refused template simply did not exist on the store. When the refused file was a new version of a template already on the store, the old version stayed in place and kept rendering.
Why did this error appear on a template I never changed?
Because somebody removed a block type from a section's schema while a saved template still used it. Shopify checks templates against the schema when the template is saved, not when the schema changes. In our test:
- A template held a
textblock and animageblock, and both types were in the schema. - We deleted
imagefrom the section's schema and pushed only the section. Shopify accepted it with no warning. - The storefront kept working. The
imageblock simply stopped rendering, and the stored template still contained it. - The next time that template was uploaded, with an unrelated one word text change, Shopify refused it:
Invalid value for type in block 'z'. Type must be defined in schema. - When we put
imageback in the schema, the hidden block reappeared on the page with nothing lost.
So the error usually lands on whoever uploads next: a developer pushing the whole theme, someone re-uploading a downloaded ZIP, or a GitHub sync. It looks like a new break, but the cause is a schema edit that happened earlier. The same delay applies to settings. We changed a text setting into a number setting while the template still held the word hello; Shopify accepted the change and the page still printed hello, then refused the next upload of that template with Setting 'heading' must be a valid number.
How do I fix it?
Pick one of two fixes, depending on whether you still want the block.
| You want the block | Fix | Where |
|---|---|---|
| Yes | Add the type back to the section's blocks array, spelled exactly as the template spells it | The section's .liquid file, inside {% schema %} |
| No | Delete the block from "blocks" and its id from "block_order" | The JSON file named in the error |
To keep the block, the schema needs an entry for it, with at least a type and a name:
"blocks": [
{ "type": "text", "name": "Text", "settings": [ ... ] },
{ "type": "image", "name": "Image", "settings": [
{ "type": "image_picker", "id": "image", "label": "Image" }
] }
]
To drop it, remove the whole block entry from the template, so only the blocks you keep remain. Removing it from block_order alone is not enough, because the error is about the entry in blocks:
"blocks": {
"text_1": { "type": "text", "settings": { "text": "Hello" } }
},
"block_order": [ "text_1" ]
A few rules that follow from the test:
- Copy the type name, do not retype it. Case counts, and Shopify did not accept
Textfortext. - Before deleting a block type from a schema, search the templates for it. Search
templates/and the group files insections/for"type": "image". Every hit will fail its next upload. - Watch the other two refusals too. A template with more blocks of one type than the schema's
limit, or text in a number setting, is refused the same way, so a long lived template can fail for those reasons as well. - Do not rely on Shopify to catch bad dropdown values. It stored
centerfor a dropdown that has no center option, so the section's code should cope with an unexpected value.
Is my live store broken while this error is showing?
Usually not. The refusal happens at upload, so it affects the file you were trying to save, not the store customers see. In our test the store kept rendering the last accepted version of the template, and the rest of the theme uploaded normally. The risk is the opposite one: the change you meant to make never arrived, and it is easy to miss in a long upload log. If Shopify refuses a whole theme ZIP outright, the cause is more often a broken section schema, covered in why a Shopify theme ZIP will not upload.
Where these results come from
Every message and behaviour above comes from one test theme with 13 cases, pushed to a Shopify development store with Shopify CLI 3.93.1 on 25 October 2026, checked by pulling the stored files back and by loading the storefront preview, and deleted afterwards. We tested with the command line, not the Shopify admin's Upload theme button, so the admin may lay the same message out differently. The header case also matches our own error log, where a generated theme hit it in May 2026.
For the other schema errors Shopify gives at upload, see what "default can't be blank" means. If you are still learning how sections and blocks relate, the difference between a section and a block covers the schema this error is about, and how to loop through blocks in a section shows the code side.
Frequently asked questions
What does "Type must be defined in schema" mean in Shopify?
A template or section group file contains a block whose type is not listed in the blocks array of that section's schema, so Shopify refuses to save the file. The full message is "Invalid value for type in block 'z'. Type must be defined in schema.", where 'z' is the block's id in the JSON file.
How do I fix "Invalid value for type in block"?
Either add the block type to the section's blocks array in its schema, spelled exactly as the template spells it, or delete the block from the template's blocks object and its id from block_order. The file named in the error is the template, not the section.
Is the block id in the error the same as the block type?
No. The value in quotes, such as 'nav_4' or 'text_aB3x', is the key of the block inside the JSON file. Search the template for it, then read its "type" value; that type is what the schema is missing.
Why does the error appear on a template I did not edit?
Someone removed a block type from the section schema while a saved template still used it. In our 25 October 2026 test Shopify accepted that schema change silently, hid the block on the storefront, and only refused the template the next time it was uploaded.
Does Shopify delete blocks when I remove their type from the schema?
Not in our test. The block stayed in the stored template and simply stopped rendering. When we added the type back to the schema, the block reappeared on the page.
Is block type matching case sensitive in Shopify?
Yes. A template block of type "Text" was refused on a section that declares "text", with the same Type must be defined in schema error.
Does one refused template stop the whole theme upload?
Not when pushing with Shopify CLI. In our test Shopify uploaded every other file, reported the theme as pushed with errors, and left the refused template off the store. Where an older version of that template already existed, the older version kept rendering.
What does "Block type must be an app block path" mean?
A template has a block of type @app on a section that does not accept app blocks. Add { "type": "@app" } to that section's blocks array, or remove the block from the template.
Generate a theme that looks like your brand
A complete Shopify 2.0 theme with conversion features built in, ready in minutes. No credit card required.
Generate my theme freeNo Shopify store yet? Start one here, then bring the theme. Themr may earn a commission if you start a paid plan; it does not change what you pay.