I read the answer that problem can cause using fetch instead of axios.
Is not true, fault is incorrect request/body (you need look in your code).
For all who is looking for answers pleas be aware that is different solution if you create app by creat-react-app and don't have a webpack.config.js. Then enough what you need to set up is adding proxy to your package.json
How should look proper fetch request:
const options = {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, cors, *same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'include', // include, *same-origin, omit, chosen include to allowed sending cookies
headers: {
'Content-Type': 'application/json',
COOKIE: 'key=value; Path=/; Expires=Thu, 09 Jul 2020 07:20:21 GMT; HttpOnly',
},
body: JSON.stringify({ something }), // body data type must match "Content-Type" header in this case it is json
})
fetch(url, options)
.then(res => {
//return res.json!
return res.json();
})
.then(data => {
// do something with data
})
For better debugging is good add a printscreen of network tab from dev tools