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.

source problem page

https://shop.dermagevity.com/products/eyelastin

I have a script fragment that used to be an app which was removed. Shopify still thinks it is live, so runs it and gets a 404 on the called resource - tmpopup.js

<script>(function() {
  function asyncLoad() {
    var urls = ["https:\/\/d16x9pmufyvewt.cloudfront.net\/tmpopup.js?shop=dermagevity.myshopify.com","https:\/\/omnisrc.com\/inShop\/Embed\/shopify.js?shop=dermagevity.myshopify.com","https:\/\/www.stilyoapps.com\/reconvert\/assets\/js\/store_reconvert.js?shop=dermagevity.myshopify.com"];
    for (var i = 0; i < urls.length; i++) {
      var s = document.createElement('script');
      s.type = 'text/javascript';
      s.async = true;
      s.src=urls[i];
      var x = document.getElementsByTagName('script')[0];
      x.parentNode.insertBefore(s, x);
    }
  };
  if(window.attachEvent) {
    window.attachEvent('onload', asyncLoad);
  } else {
    window.addEventListener('load', asyncLoad, false);
  }
})();</script>

It loads in the head section. I assume that shopify injects the code because the other two apps are in my app dashboard, and this script doesn’t exist in my theme files.

Frankly I am sick of dealing with unresponsive app developers, and I reckon this is a shopify issue not an app dev issue anyway.

Any help appreciated in figuring this out

Thanks

Rick

Hi Rick,
Did you check the content of theme.liquid file?

Can you posted them here?

Contents of Theme.liquid

{%- if settings.favicon != blank -%}

{%- endif -%}

{%- if settings.favicon_retina != blank -%}

{%- endif -%}

{%- capture seo_title -%}
{{- page_title -}}
{%- if current_tags -%}
{%- assign meta_tags = current_tags | join: ', ’ %} – {{ ‘general.meta.tags’ | t: tags: meta_tags -}}
{%- endif -%}
{%- if current_page != 1 -%}
 â€“ {{ ‘general.meta.page’ | t: page: current_page }}
{%- endif -%}
{%- unless page_title contains shop.name -%}
 â€“ {{ shop.name }}
{%- endunless -%}
{%- endcapture -%}

{{ seo_title }}

{%- if page_description -%}

{%- endif -%}

{%- include ‘social-meta-tags’ -%}
{%- include ‘shopify-head-tag’ -%}
{%- include ‘weketing-tracking’ -%}

{{ content_for_header }}

{{ “lazysizes.min.js” | asset_url | script_tag }}

.lazyload,.lazyloading{opacity:0}.lazyloaded{opacity:1;transition:opacity.3s}

{%- assign default_rtl_support = settings.rtl_support -%}
{%- assign default_catalog_mode = settings.catalog_mode -%}
{%- if settings.roar_themedemo -%}
{%- capture shop_demo -%}{% include ‘querystring’, name: ‘type’ %}{%- endcapture -%}
{%- if shop_demo == ‘catalog-mode’ -%}{% assign default_catalog_mode = true %}{%- endif -%}
{%- endif -%}

{%- include 'global-symbols' -%} {%- include 'age-check' -%} {%- section 'header-mobile' -%} {%- section 'header' -%} {%- section 'header-menu' -%} {%- section 'header-menu-vertical' -%}
{{ content_for_layout }}

{%- section ‘footer’ -%}
{%- section ‘copyright’ -%}

{%- include 'theme-demo' -%} {%- include 'photoswipe' -%}

Fixed it. Hired a dev.

Same problem, but I can’t see the solution here

1 Like

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

Hey Rrakausk - also having a problem with this script interfering with apps on our shopfiy store. You said you got a developer that solved the issue. Could you share their contact info with me please?

You marked your answer as a solution but it does not contain the solution. This is misleading and does not help anyone else who is stumbling upon this page experiencing the same issue.

To anyone who is still wondering what vendor this mysterious script belongs to, it is Lucky Orange.

2 Likes