Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

cannot import script file from asset directory. #612

Closed
awesomenkj opened this issue May 31, 2018 · 3 comments
Closed

cannot import script file from asset directory. #612

awesomenkj opened this issue May 31, 2018 · 3 comments

Comments

@awesomenkj
Copy link

Problem

Cannot import custom js file from asset directory

<script src="{{ '../assets/scripts/vendor/app.js' }} | asset_url"></script>

This is causing MIME type issue due to timestampe numbers
(https://cdn.shopify..... js?234234234242)

also tried to import from static directory

<script src="{{ 'app.js' }} | asset_url"></script>

This caused 404 error.

And tried to add double quote in the url like this

<script src="{{ "../assets/scripts/vendor/app.js" }} | asset_url"></script>
@maxcr
Copy link

maxcr commented May 31, 2018

Did you declare it in theme.js first?

src/assets/scripts

This folder constains all your JS modules. A theme.js must be present, as it will act as the entry point for your JS application.

@t-kelly
Copy link
Contributor

t-kelly commented Jun 18, 2018

Duplicate of #409

@t-kelly t-kelly marked this as a duplicate of #409 Jun 18, 2018
@t-kelly t-kelly closed this as completed Jun 18, 2018
@lock
Copy link

lock bot commented Oct 26, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants