from origin 'http://localhost:3003' 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 '*, *', 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.
when i post request using the other domain serves how i solve the problem!!
For development you can use proxy to localhost:3003. Write this line in package.json of react project. "proxy": "http://localhost:3003".
To solve this issue, you will have to do in backend, for example if you backend is in nodejs then you can use CORS package.
Install cors package.
npm i cors
and then in your nodejs file write this
var cors = require('cors');
app.use(cors())
To configure cors you can refer documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With