Homepage

LiquidHTMLSyntaxError

Last edit: Aug 06, 2026

LiquidHTMLSyntaxError

Severity: error | Type: LiquidHtml | Aliases: SyntaxError, HtmlParsingError

This check informs you of Liquid and HTML syntax errors early, aiming to eliminate syntax errors in Liquid templates. It covers both Liquid syntax problems and HTML parsing errors in the same file.

Common Liquid syntax errors detected:

  • Missing closing tags (e.g. {% include 'x' without closing %})
  • Malformed assignments (e.g. {% assign foo = 1 }})
  • Unknown tags
  • Invalid conditional syntax (e.g. using | instead of . for size checks)
  • Unknown comparison operators in conditions (e.g. {% if var ctn "hello" %} — only ==, !=, >, <, >=, <= and contains are valid; anything else raises Unknown operator when the page renders)
  • Incomplete conditions (a missing right-hand side like {% if var == %}, or a trailing and/or)
  • Junk in conditions that the runtime silently ignores (filter pipes such as {% if items | size > 0 %}, or JavaScript-style &&/||)
  • A misspelled or missing in keyword in loops (e.g. {% for x inn arr %})
  • Ignored values in when branches (e.g. {% when 1 huh 2 %} — values must be separated by , or or)

Examples

✗ Incorrect Code Example (Avoid using this):


{% include 'muffin'
{% assign foo = 1 }}
{% unknown %}
{% if collection | size > 0 %}
{% if var ctn "hello" %}
{% for item inn items %}

✓ Correct Code Example (Use this instead):


{% render 'muffin' %}
{% assign foo = 1 %}
{% if collection.size > 0 %}
{% if var contains "hello" %}
{% for item in items %}

Configuration

The default configuration for this check:

LiquidHTMLSyntaxError:
  enabled: true
  severity: error

Disabling This Check

Disabling this check is not recommended. Syntax errors prevent your templates from rendering correctly.

Resources

Questions?

We are always happy to help with any questions you may have.

contact us