CORS Error: Response to preflight request doesn't pass access control check

Hi, @Vijay_Kumar I hope you were able to solve this problem, sorry for not replying for a long time, yes I have solved the problem

Solution:

The first thing to do is to make sure you have shopify app proxy configured:

[app_proxy]
  url = ‘https://anti-inline-bee-taking.trycloudflare.com’
  subpath = ‘api’
  prefix = ‘apps’

The proxied URL to use in your storefront would be: https://example.myshopify.com/apps/api/nameofscript

The next step, to transfer the user’s cookie from the storefront: The solution to the problem was only to pass the cookie inside the request, if you use the cors policy it won’t work, because cloudflare rewrites it.

1 Like