Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Script tag loaded and excecuted only on page reload, not working on url change #975

Open Stas-Buzunko opened 5 years ago

Stas-Buzunko commented 5 years ago

I have scripts -> templates -> customers -> account.js

it's loaded and executed when i'm on /account and reload the page

but it doesn't load when i visit '/' -> click '/account'

I can't understand why. Content of a script doesn't matter in my case. Even simple console.log not called.

Here is how I import script-tag in templates -> customers -> account.liquid

{% include 'script-tags', template: 'customers/account' %}
{% include 'script-tags' %}
<script src='{{ 'template.account.js' | asset_url }}' defer='defer'></script>

2 of these 3 work on reload, but none works on route change. I have no idea what's going on. Any help would be appreciated

Stas-Buzunko commented 5 years ago

UPD: in deployed theme script is not executed even on page load

Stas-Buzunko commented 5 years ago
screenshot 2019-02-09 at 14 10 15

it's referenced, content is correct, why the hell it's not executed?