Liquid is generally forgiving, but when it breaks, it breaks hard. Seeing Liquid error: internal or a broken layout can be panic-inducing. Here are the most common errors and how to fix them.

1. 'Liquid error: internal'

Cause: Often caused by memory limits or infinite loops.

Fix: Check your for loops. Ensure you aren't looping through a massive collection without pagination (limit: 50). Check for circular includes.

2. 'Array '...' is not a valid object'

Cause: Trying to access a property on an array instead of an object.

Fix: You likely need to loop through the array first. Use {% for item in array %}.

3. Unexpected 'else'

Cause: Malformed if/else block. Usually a missing {% endif %} or an extra tag.

Fix: Indent your code properly. Use a linter or IDE extension to match opening and closing tags.

Debugging Tools

Use the {{ variable | json }} filter to inspect data structures. It's the console.log of Liquid. Also, the Shopify Theme Inspector Chrome extension is invaluable for profiling render performance.