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.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025