App reviews, troubleshooting, and recommendations
Hello,
I am new to shopify app development and I am develping a test app in react that will add a button under add to cart button on product page. In web/frontend/page/index.jsx i have added below code for script tags. I know this is not the right file please let me know where should write this code to add script tags so its loaded automatically when app is insatlled. I am getting this error
Access to XMLHttpRequest at 'https://test-shop.myshopify.com/admin/api/2021-04/script_tags.json' from origin 'https://682ed-115-186-141-90.ap.ngrok.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I have setup the proxy settings in app setup and added the ngrok url https://682ed-115-186-141-90.ap.ngrok.io in proxu url but still getting same error.
web/frontend/page/index.js
The CORS issue is due to ngrok not your api header. You just simply change ngrok link to localhost and that can be solved.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025