I have a problem when I deploy react app to Heroku:
Access to fetch at 'https://rs-yoga-prod.herokuapp.com/' from origin 'https://rs-react-prod.herokuapp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://rs-react-prod.herokuapp.com/' that is not equal to the supplied origin. 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.
I've researched and added proxy
in package.json
like this:
"proxy": {
"dev": { "target": "http://localhost:4000"},
"prod": { "target": "https://rs-yoga-prod.herokuapp.com" }
}
But it still show error, what did I'm wrong ?
server URL: https://rs-yoga-prod.herokuapp.com
client URL: https://rs-react-prod.herokuapp.com
You can access these URL for more detail, thanks.