Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Configuring the script tags is causing errors

Configuring the script tags is causing errors

yehiasalam
Visitor
2 0 0

Hi,

I'm building my custom app using the shopify-cli and shopify_app, and everything was working fine. I'm trying right now to add an external js file to the frontstore, using the config.scripttags as instructed in the docs:

ShopifyApp.configure do |config|
  config.application_name = "My Shopify App"
  config.api_key = ENV.fetch('SHOPIFY_API_KEY', '').presence || raise('Missing SHOPIFY_API_KEY')
  config.secret = ENV.fetch('SHOPIFY_API_SECRET', '').presence || raise('Missing SHOPIFY_API_SECRET')
  config.old_secret = ""
  config.scope = "write_script_tags" # Consult this page for more scope options:
                                 # https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
  config.embedded_app = true
  config.after_authenticate_job = false
  config.api_version = "2020-10"
  config.shop_session_repository = 'Shop'
  config.allow_jwt_authentication = true
  config.allow_cookie_authentication = false

  config.scripttags = [
    {event:'onload', src: 'https://x.x.com/widget/widget.js'}
  ]
end

However, whenever I install the app i keep getting the following error, and this happens after adding:

 

  config.scripttags = [
    {event:'onload', src: 'https://x.x.com/widget/widget.js'}
  ]

 

 Not sure what might the problem might be. It shouldn't be related to Auth i guess since it was working fine before adding the scripttags config.

102826352-26a94300-43e9-11eb-86c6-1bf0fc6e9dad.png

 

Reply 1 (1)

yehiasalam
Visitor
2 0 0

any ideas guys? really stuck on this.