I have developed the Woocommerce ionic app but when i connect the app with live site or server then its gives this error :
Access to fetch at 'https://www.example.co.uk/shop/wp-json/v3/products/categories?filter[meta]=true&filter[variation]=true'
from origin 'http://localhost:8100' has been blocked by CORS policy: Response to preflight
request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains
multiple values 'http://localhost:8100, *', but only one is allowed. Have the server send the
header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Please see the below screenshots as well :
To resolve this error i have also paste the below code on my server .htaccess file :
Header set Access-Control-Allow-Methods "HEAD, POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type,Credentials"
But still it showing the same error.
Before 1 months its working fine. I am using ionic CLI version is : 3.4.0 and npm version is : 6.6.0