Getting Invalid value for type in block 'product_video'. Type must be defined in schema Error

Topic summary

A user encounters a schema validation error when attempting to save their product.json file after adding a custom product video block. The error message indicates that the block type ‘product_video’ is not properly defined in the schema.

Code Issues Identified:

  • The product-video.liquid file appears corrupted with reversed/garbled text
  • Missing closing characters (%}) in the liquid file
  • Schema definition may be improperly structured

Suggested Solution:

  • Fix the missing closing characters in the liquid file
  • Remove schema from the snippet if it’s not a section file (snippets don’t require schemas)
  • Temporarily strip down product.json to isolate the problematic code
  • Check for typos and gradually add components back once the core issue is resolved

Status: The discussion remains open with initial troubleshooting guidance provided but no confirmed resolution yet.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

I an getting the “Invalid value for type in block ‘product_video’. Type must be defined in schema” error when I try to save my product.json file. Below I will first provide a the product.json code and the product-video.liquid file. Ihave been working with this for the last hour and I an at a total loss. Your help would be greatly appreciated.

product.json

{
    "sections": {
      "main": {
        "type": "main-product",
        "blocks": {
          "product_meta": {
            "type": "product_meta",
            "settings": {}
          },
          "variant_selector": {
            "type": "variant_selector",
            "settings": {}
          },
          "buy_buttons": {
            "type": "buy_buttons",
            "settings": {}
          },
          "description": {
            "type": "description",
            "settings": {}
          },
          "product_video": {  
            "type": "product_video",
            "settings": {}
          }
        },
        "block_order": [
          "product_meta",
          "variant_selector",
          "buy_buttons",
          "description",
          "product_video" 
        ],
        "settings": {}
      },
      "product-recommendations": {
        "type": "product-recommendations",
        "settings": {}
      },
      "recently-viewed-products": {
        "type": "recently-viewed-products",
        "settings": {}
      }
    },
    "order": [
      "main",
      "product-recommendations",
      "recently-viewed-products"
    ]
  }
  

product_video.liquid file

 {% if product.metafields.custom.videos %}
    <div class="product-videos">
      <h3>Product Videos</h3>
      <div class="videos-container">
        {% assign videos = product.metafields.custom.videos | split: ',' %}
        {% for video in videos %}
          <div class="video-wrapper">
            <iframe width="560" height="315" 
                    src="{{ video | remove: 'https://youtu.be/' | prepend: 'https://www.youtube.com/embed/' }}" 
                    frameborder="0" 
                    allowfullscreen>
            </iframe>
          </div>
        {% endfor %}
      </div>
    </div>
  {% endif %}
  
  {% schema %}
  {
    "name": "Product Video",
    "settings": [],
    "presets": [
      {
        "name": "Default",
        "category": "Custom"
      }
    ]
  }
  {% endschema  
1 Like

Hi @DFlores1 , the product_video.liquid file you posted is missing closing characters: %}

And if that’s a snippet it doesn’t need a schema.

If the product.json is giving issues, strip out everything but the focus of concern until it’s fixed such as making sure there’s no typos, then throw everything back in after it’s working.

If you need theme repair or theme customization you can contact me by my email
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Good Hunting.