I encountered an issue where a Shopify merchant reported their size chart script wasn’t loading. The script URL is stored in a [theme app extension] metafield, and is only rendered if the value is not blank via this Liquid condition:
{% if app.metafields.name != blank %}
<script type='text/javascript' src="{{ app.metafields.name }}" async></script>
{% endif %}
Even though the metafield had a valid script URL stored, the Liquid condition intermittently treated it as blank. This behavior was inconsistent across browsers and refreshes — sometimes the script would load, sometimes it wouldn’t. After toggling the theme app extension off and back on, the issue resolved and the metafield loaded properly every time.
Key Observations:
- The metafield was not actually empty, yet rendered as blank in Liquid under certain conditions.
- Refreshing the page would sometimes flip the result (script shows up or doesn’t).
- Toggling the theme app extension acted as a cache reset and resolved the issue.
- No recent changes had been made to the metafield for over 90 minutes.
- This appears to be a possible edge caching issue or a Shopify metafield read inconsistency .
- The rest of the theme extension loaded correctly — only the conditional metafield was affected.
Has anyone else experienced metafields intermittently loading as blank in theme app extensions due to caching or Liquid rendering quirks?