Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!