Liquid, JavaScript, themes, sales channels
My site is slowing down due to 400-level errors thrown by shopify trying to load scripts that don't exist. It seems that the scripts are being pulled in from a function called `asyncLoad()` in the head of the page, here:
(function() {
function asyncLoad() {
var urls = ["https:\/\/shy.elfsight.com\/p\/platform.js?v=1.5.12\u0026shop=nakedpoppy.myshopify.com","https:\/\/cdn.judge.me\/assets\/installed.js?shop=nakedpoppy.myshopify.com","https:\/\/cdn.reamaze.com\/assets\/reamaze-loader.js?shop=nakedpoppy.myshopify.com","https:\/\/str.rise-ai.com\/?shop=nakedpoppy.myshopify.com","https:\/\/strn.rise-ai.com\/?shop=nakedpoppy.myshopify.com","https:\/\/static.klaviyo.com\/onsite\/js\/klaviyo.js?company_id=QHkXdf\u0026shop=nakedpoppy.myshopify.com","https:\/\/cdn.routeapp.io\/route-widget-shopify\/stable\/route-widget-shopify-stable.min.js?shop=nakedpoppy.myshopify.com","https:\/\/shopify-apps-files.s3.amazonaws.com\/script_tag.js?shop=nakedpoppy.myshopify.com","https:\/\/sfdr.co\/sfdr.js?sid=41388\u0026shop=nakedpoppy.myshopify.com","https:\/\/giftbox.ds-cdn.com\/static\/main.js?shop=nakedpoppy.myshopify.com","https:\/\/cdn.shopify.com\/s\/files\/1\/2660\/7058\/t\/95\/assets\/subscribe-it.js?v=1613681610\u0026shop=nakedpoppy.myshopify.com","https:\/\/customers.shop.paywhirl.com\/js\/post-checkout-widget.js?shop=nakedpoppy.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);
}
})();
However, two of the scripts that this function tries to load don't exist, and cause errors which are leading to chrome calling the page unresponsive (https://cdn.shopify.com/s/files/1/2660/7058/t/95/assets/subscribe-it.js?v=1613681610&shop=nakedpoppy... and https://shopify-apps-files.s3.amazonaws.com/script_tag.js?shop=nakedpoppy.myshopify.com). Neither of these scripts are referenced anywhere in my theme, and the apps are not installed in my shopify store. How do I cause this code to update so that it no longer tries to load scripts that don't exist?
We are facing the same issue, any updates here?
I ended up with a very hacky solution to this:
set the content for header to a new variable and then manipulate that variable and spit it back out:
{% capture edited_content_for_header %}
{{ content_for_header }}
{% endcapture %}
{{ edited_content_for_header | remove: '"https:\/\/cdn.shopify.com\/s\/files\/1\/2660\/7058\/t\/95\/assets\/subscribe-it.js?v=1613681610\u0026shop=nakedpoppy.myshopify.com",' | remove: '"https:\/\/shopify-apps-files.s3.amazonaws.com\/script_tag.js?shop=nakedpoppy.myshopify.com",' }}
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024