Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need to prevent SystemJS attempting to load dependencies on Shopify site, urls require a version parameter that SystemJS doesn't know #2481

Open
twilson90 opened this issue Feb 23, 2024 · 1 comment

Comments

@twilson90
Copy link

twilson90 commented Feb 23, 2024

I'm trying to set up a project for compiling all the javascript in a shopify theme but I've run into a snag.

I have my main 'app.system.js' script that loads on page load, and additional system.js scripts that load along with any html based components in a svelte-like way.

In my head element:

<script src="{{ 'system.js' | asset_url }}" defer></script>
<script type="systemjs-module" src="{{ 'app.system.js' | asset_url }}" defer></script>

And a component further down in the body looks like this:

<script type="systemjs-module" src="{{ "flipdown.system.js" | asset_url }}" defer></script>
{{ "flipdown.css" | asset_url | stylesheet_tag }}
<div data-component="flipdown" data-date-end="{{ date }}"></div>

But when it tries to load 'flipdown.system.js', it tries to load its dependency 'app.system.js', but it fetches a URL without the necessary v?= parameter, which causes it to load the first version that I uploaded to my store, which causes havoc.

So I get this happening:

chrome_GA2cTFcrk5

Is there any way around this?

@tbrannam
Copy link

tbrannam commented May 2, 2024

I'm not familiar with the systemjs-module syntax, but I would assume that the 'dependencies' within your modules are referencing the undecorated name 'app.system.js' - are you using an import-map as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants