Shopify theme check ignores liquid within HTML comments

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Theme

Expected behavior

shopify theme check should handle liquid within HTML comments, since Shopify’s server-side implementation seem to parse that normally in actual use (for example see #666 in the Liquid repo from way back when, matching my experience with a real theme too).

Actual behavior

The liquid code seems to be ignored, for example variables defined there result in a UndefinedObject warning when referenced later.

Reproduction steps

Create templates/page.test.liquid containing something like <!-- {% assign blah = 5 %} --> {{ blah }} and then run shopify theme check.

Verbose output

2026-01-10T17:00:42.516Z: Sync-reading the content of file at templates/page.test.liquid...
╭─ info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                    │
│  templates/page.test.liquid                                                                                                        │
│                                                                                                                                    │
│                                                                                                                                    │
│  [warning]: UndefinedObject                                                                                                        │
│  Unknown object 'blah' used.                                                                                                       │
│                                                                                                                                    │
│  1  <!-- {% assign blah = 5 %} --> {{ blah }}                                                                                      │
│                                                                                                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Operating system

Mac OS Sonoma

CLI version

3.88.1

Shell

bash

Nodejs version

v25.2.1

Hi @jessec,

Good point. HTML comments can’t be used to comment out Liquid, but Theme Check is currently flagging it as if they can.

Thanks for flagging this. We’ll look into correcting the check and will post an update here once we do.

Hi @jessec

Our team has confirmed this is an issue with theme check, and it’s on their radar to address - however there’s no ETA I can share for resolving this.

@Liam-Shopify @Paige-Shopify thank you both! No urgency at all from me on this. I was surprised to see I even had Liquid code within HTML comments anywhere in my theme, but when I saw the discrepancy with theme check I figured I’d point it out.

2 Likes