Skip to content

The comment that switched off the code below it

Date

28 Aug 2026

Category

Gotcha

Platform

Shopify

A theme file would not sync. The error was a syntax error, and it named a line containing an ordinary comparison between two numbers. That line was correct. Rewriting it moved the error rather than clearing it, which is usually the signal that you are looking in the wrong place.

What we found

Liquid’s multi-line tag lets you write several statements without wrapping each one, and inside it a hash starts a comment. Comments are prose, so people write prose in them, and prose about Liquid tends to contain Liquid.

A closing tag sequence inside one of those comments closes the block. Not the comment, the whole block. Everything below it stops being code and becomes text on the page.

That is the part worth remembering, because it normally happens in complete silence. The statements simply never run. Values are never assigned, conditions are never evaluated, and the page renders with things missing rather than broken. It only becomes an error at all if the orphaned text happens to contain a less-than sign, which then gets read as the start of an HTML tag. That is why the error appeared on an innocent line, and why editing that line moved it around.

Two earlier explanations for this looked completely plausible and were both wrong. What settled it was writing two files identical except for those two characters inside the comment: one failed, one was clean.

What we did

Removed the closing sequence from the comment, and corrected the theme’s own notes, including an explicit line saying that one of the earlier explanations is not real so nobody goes hunting for it later.

The tool that catches this class of problem is the platform’s own theme check. It is worth being specific about how to run it, though: a mature theme carries pre-existing errors from apps and from stock files, so a raw error count tells you nothing. Filter it to the files you touched and read those.

What to take from it

A syntax error that points at a line you are sure about is usually a block that ended earlier than you think. Look upwards for something that closed it, and check comments before you check code, because a comment is the one place you stop reading carefully.

The broader version of this: on a theme that deploys from a repository, a file that fails to parse does not fail loudly on the storefront, it simply stops arriving. The sync is the thing to watch, not the page. If a change you shipped is not visible, confirm the file actually landed before you start debugging what you wrote.