Blocked by CORS policy Issue


I have developed a user interface using the ReactJS framework and I am attempting to retrieve data from the Panatris APIs to display within the UI. However, I am encountering an error message that reads “Access to fetch at ‘(’ from origin ‘http://localhost:3000’ 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.” This message indicates that the CORS policy is blocking access to the requested resource, and that the server is not configured to allow requests from the domain of my React application. I would like to know how to resolve this issue.

Hey, for security reasons we don’t allow access from the browser from websites, which are not hosted by us (e.g. localhost). You either can deploy your frontend to a sandbox in PANTARIS or you can proxy the requests on your local device (e.g. through an API of the frontend).

Tried hosting in pantaris sandbox, still getting same console error.

Not sure, what url you want to call as there is a getProjectData in the url.

The platform API is at (see Documentation | PANTARIS)

getProjectData is our api endpoint hosted in PANTARIS, we get same even when we call PANTARIS Api’s.

Looks like a different app-instance in the screen. Make sure to not hard-code the id.

CORS errors also sometimes show up, when the authentifcation is not set correctly. Verify cookie settings on the request.

If you still have issues create a ticket and provide the complete requests there (copy as curl)