FROM CACHE - en_header

Script Tag routing issue.

Shopify Partner
113 2 15

I have a scripttag that I load into the store using the shopify_app initializer within my app like this:

config.scripttags = [{event: 'onload', src: ""}]

On the store-side I get this message in the console:

Loading failed for the <script> with source “”.

In the app logs I get this error:

ActionController::RoutingError (No route matches [GET] "/scripts/myscript.js")

Does ScripttagsManager not handle routing for the script tag in the same way that WebhooksManager does?

Do the routes have to be created manually for each script tag?

What am I missing here?

Replies 2 (2)
Shopify Partner
113 2 15

Can anyone help with this? Or can anyone suggest another way to properly load Script Tags?

New Member
6 0 0

I was having the same problem so I transferred the script to public/ file and it's working now. But I don't want it to have it in the public folder,  I want it inside my javascript folder. What do I need to do to achieve that?  I am using rails 6 with webpacker. @_JB Could you please help me here ?