Why is Shopify still running a removed script causing a 404 error?

Topic summary

A Shopify store is experiencing persistent 404 errors from a script (tmpopup.js) belonging to a previously removed app. The script continues loading via the {{ content_for_header }} Liquid tag in theme.liquid, which Shopify uses to inject app code.

Root Cause:
The asyncLoad() function in content_for_header attempts to load scripts from removed apps. Simply uninstalling the app doesn’t always remove these script references from Shopify’s system.

Proposed Solution:
One user suggests manually filtering out the problematic script by replacing {{ content_for_header }} with a modified version that uses Liquid’s remove filter:

{% capture content_for_header_modified %}{{ content_for_header }}{% endcapture %}
{% assign content_for_header_modified = content_for_header_modified | remove: 'https://d16x9pmufyvewt.cloudfront.net/tmpopup.js?shop=dermagevity.myshopify.com' %}
{{ content_for_header_modified }}

Current Status:
The original poster claims to have fixed it by hiring a developer but didn’t share the actual solution, frustrating other users experiencing the same issue. The script has been identified as belonging to Lucky Orange analytics service.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

this function

  function asyncLoad() 

is loaded in {{ content_for_header }} in your theme.liquid header.

This function is being used to load app script after the “onload” event. Deleting the app should remove the offending entry.

Alternatively, you can do it manually by replacing {{ content_for_header }} with this:

{% capture modified_content_for_header %}{{ content_for_header }}{% endcapture %}

{% assign modified_content_for_header = modified_content_for_header | remove: '"https:\/\/d16x9pmufyvewt.cloudfront.net\/tmpopup.js?shop=dermagevity.myshopify/com",' %}

{{ modified_content_for_header }}
3 Likes