We're running into some CORS errors, and after sea...
# gooddata-cn
a
We're running into some CORS errors, and after searching the posts here I haven't found a match.
Copy code
Access to XMLHttpRequest at '<url>' from origin '<https://localhost:3000>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
j
Hello Adam! Could you please tell us what are you trying to achieve? I assume you are running the GoodData.CN Community Edition, correct? And you are trying to connect to it from a GoodData.UI web application? Please provide more information like domains and hosts so that we can assist. Thanks!
Also, there's this documentation about CORS when implementing a custom JavaScript application using GoodData.UI. I'm not sure how relevant it is to your use-case, but maybe it could help: https://sdk.gooddata.com/gooddata-ui/docs/platform_cors.html.
a
We used the accelerator toolkit to make a tiger application. This CORS error is occurring when we try to request an insight from the CN endpoint.
We are attaching a token to header correctly, but never get past the inital CORS issues.
j
Hello Adam! I just tested myself. The command
npx --ignore-existing @gooddata/create-gooddata-react-app --backend=tiger
installed a web application boilerplate with GoodData.UI version 8.8.0, and I'm running it against a GoodData.CN CE instance version 1.6.0. By default, the GD.CN instance runs at http://localhost:3000/, and the web app runs at http://localhost:8443. Since the domain is simply
localhost
for both, there were no CORS issues and I was able to render a
<Headline />
component without problems.
When the create-gooddata-react-app CLI asks you to provide the domain, make sure you enter HTTP://localhost:3000, and NOT HTTP*S*.
Screen Shot 2022-03-21 at 19.25.32.png