Metafield Loading Blank Intermittently in Theme App Extension

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?

Hi Zachary,

Do you know if this is only happening with one specific merchant, or can you replicate on a test store?

It has happened on more than one store. I’ve brought this issue up in the past with merchants claiming they turned off and on the theme app extension. Both Plus and non-plus stores.

This is the first time I’ve caught it before the merchant has “hard” reset it with the turning off and back on the theme extension.

The theme app extension is loading. It seems to be within the metafield or the blank statement within liquid.