theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

When I format Liquid code with Shopify Liquid then it is replaced with empty code

Open mdarifulislamroni521 opened this issue 5 months ago • 1 comments

Describe the bug

When I format Liquid code using the Shopify Liquid formatter, the code is replaced with an empty block. This happens consistently and removes all the Liquid content. Please check the attached video for a demonstration of the issue.

Source

{% if product.available %}

{{ product.title }} is available.

{% endif %}

Expected behaviour

The Liquid code should be formatted cleanly and preserved—without removing or emptying it. I expect indentation or spacing fixes, but not code deletion.

Actual behaviour

When I run the formatter (e.g., via VS Code or CLI), it removes all the code, leaving the file or snippet completely empty.

Debugging information

OS: Mac

OS Version: macOS 10.15.7

Theme Check Version: 1.15.0

Shopify Liquid Formatter: Shopify.theme-check-vscode

Additional context When I format Liquid code with Shopify Liquid then it is replaced with empty code

https://github.com/user-attachments/assets/13f37172-dce6-406d-bebc-508c31d1c4f6

mdarifulislamroni521 avatar Jul 16 '25 07:07 mdarifulislamroni521

@mdarifulislamroni521 would you mind trying this on the Dawn or Horizon themes and letting us know if you get the same behavior? Trying to determine if this is a broad issue or something related to your specific theme. Thanks!

graygilmore avatar Jul 24 '25 16:07 graygilmore