CORS issue on Preview, but not live site

Because in preview the call is made via a different url. So probably your live site’s url is authorized to call the server but not the preview url