Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
shopify script tag api is created and loaded but code is not executing

I'm creating a shopify app but im facing some issues while working with script-tag api

I have created a script tag using this code:

    router.get("/scripts-tag/create",async (ctx)=>{
      ctx.body = await client.post({
        path: 'script_tags',
        data: {"script_tag":{"event":"onload","src":"https://xxxxx.ngrok.io/_next/static/chunks/pages/script-tag.js"}},
        type: DataType.JSON,
      });
    })

With this response:

  "body": {
    "script_tag": {
      "id": 173210206277,
      "src": "https://xxxxx.ngrok.io/_next/static/chunks/pages/script-tag.js",
      "event": "onload",
      "created_at": "2022-02-08T22:39:43+05:00",
      "updated_at": "2022-02-08T22:39:43+05:00",
      "display_scope": "all",
      "cache": false
    }
  },
  "headers": {}
}

script-tag.js:

import React from "react";

export default function scriptTag(){
    alert("hello")
}

i have also used this code before:

alert("hello world")

but the the real issue i'm facing is when i'm opening the store script is loaded in store

you can see in the above image that script is loaded in store page but the script code is not executed.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda