FROM CACHE - en_header

Problem in shopify extension push

salehmatul
New Member
1 0 1

Hi good peoples. I was looking for a help. any comment is highly appreciated .
I'm using shopify cli to push my app's theme extension. Basically the app was build with script tag, so we just put same piece of js code in blocks to product the result. 
After it when we go for a push extension sometimes it does without a problem but most of the time if gives an error like bellow 

salehmatul_0-1628922867081.png

And the code is : 

 

 

{{ 'style.css' | asset_url | stylesheet_tag }}

<script>
    var stickyScriptLoaded = 0;
    var atcscript;
    var runnersticky;
    var atcPageList = {{ shop.metafields.sticky_atc.page_list_atc }};
    var atcDesktopSettings = {{ shop.metafields.sticky_atc.desktop_sttings_atc }};
    var atcMobileSettings = {{ shop.metafields.sticky_atc.mobile_sttings_atc }};
    var atcPreviewDesktopSettings = {{ shop.metafields.sticky_atc.preview_desk_settings_atc }};
    var atcPreviewMobileSettings = {{ shop.metafields.sticky_atc.preview_mob_settings_atc }};
</script>
{% if shop.metafields.sticky_atc.preview_page_settings_atc != blank %}
<script>
    var atcPreviewPageSettings = {{ shop.metafields.sticky_atc.preview_page_settings_atc }};
</script>
{% endif %}


{% assign atcAllScripts = "sticky_variables.js
,sticky_helper.js
,sticky_onscroll.js
,sticky_container_create.js
,sticky_positions.js
,sticky_downcaret_svg.js
,sticky_button_svg.js
,sticky_after_button_click.js
,sticky_button_create.js
,sticky_savehistory.js
,sticky_chathead.js
,sticky_put_variant_option.js
,sticky_hide_on_viewpoint.js
,sticky_reconfig_drawing.js
,sticky_contruct_data.js
,sticky_custom_page.js
,sticky_get_svg.js
,sticky_draw_image.js
,sticky_drawhandle.js
,sticky_app_preview.js"| split: ',' %}

{% for scriptname in atcAllScripts %}
<script>
    atcscript = document.createElement("script");
    atcscript.src="{{ scriptname |asset_url}}";
    atcscript.defer = true;
    atcscript.type = "text/javascript"
    atcscript.onload = () => {
        stickyScriptLoaded++;
    if (stickyScriptLoaded == {{ atcAllScripts.size }}) {

        runnersticky = document.createElement("script");
        runnersticky.type = "text/javascript"
        runnersticky.src="{{'sticky_app_start.js' | asset_url}}"
        runnersticky.async = true;
        document.head.append(runnersticky);
    }
        };
    document.head.append(atcscript);
</script>
{% endfor %}


{% schema %}
{
"name": "Sticky_ATC",
"tag": "section",
"templates": ["product", "collection"],
"target": "body"
}

{% endschema %}

 

 

 

Reply 1 (1)
mt686
Shopify Partner
36 6 8

Same problem here! Haven't been able to get any further error messages or help.