---
title: JSONMissingSection
description: >-
  A validation that identifies instances where a JSON template or section group
  file is referencing section types that don't exist.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/json-missing-section
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/json-missing-section.md
api_name: liquid
---

# JSONMissing​Section

Ensures that every section type referenced by a JSON template (`templates/*.json`) or a [section group](https://shopify.dev/docs/storefronts/themes/architecture/section-groups) (`sections/*.json`) refers to a section file that exists in the theme's `sections` directory.

Each entry in the top-level `sections` object of these files has a `type` property. That type must resolve to a `sections/<type>.liquid` file in the theme. Shopify runs the same validation when a theme is uploaded or published, so this check surfaces the problem while you're developing the theme.

The following section types are exempt from this check, because Shopify provides default files for them:

* `apps`
* `_blocks`

Section entries that don't have a `type` property are skipped. The `type` property at the top level of a section group file, such as `header` or `footer`, isn't a section reference, so it isn't checked.

***

## Examples

The following examples contain code snippets that either fail or pass this check.

### ✗ Fail

In the following example, the JSON template file references a section type that doesn't exist. There's no corresponding `featured-collection.liquid` file in the `sections` directory for the theme:

## templates/index.json

```json
{
  "sections": {
    "featured-collection": {
      "type": "featured-collection"
    }
  },
  "order": ["featured-collection"]
}
```

### ✗ Fail

In the following example, the section group file references a section type that doesn't exist. There's no corresponding `announcement-bar.liquid` file in the `sections` directory for the theme:

## sections/header-group.json

```json
{
  "type": "header",
  "name": "Header group",
  "sections": {
    "announcement-bar": {
      "type": "announcement-bar"
    }
  },
  "order": ["announcement-bar"]
}
```

### ✓ Pass

In the following example, the JSON template file references a section type that exists in the `sections` directory for the theme:

## templates/index.json

```json
{
  "sections": {
    "featured-collection": {
      "type": "featured-collection"
    }
  },
  "order": ["featured-collection"]
}
```

## sections/featured-collection.liquid

```liquid
{% schema %}
{
  "name": "Featured collection"
}
{% endschema %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
JSONMissingSection:
  enabled: true
  severity: error
```

| Parameter | Description |
| - | - |
| `enabled` | Whether this check is enabled. |
| `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. |

***

## Disabling this check

Disabling this check isn't recommended. A theme that references a section file that doesn't exist is rejected when it's uploaded or published.

***
