1๐
I encountered this problem, solved it by replacing localhost with 127.0.0.1, then with [::1]
A few months later, i had to go back to 127.0.0.1โฆ
Maybe did some process change my hosts file.
You should type ping localhost in your terminal in order to check your current configuration and use the result to set your proxy.
๐คDr Fred
0๐
Try this
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3001',
ws: true,
secure: false
}
}
}
}
Also, check whether you have set a base path for axios. If so, please remove api from the axios call since base path will also get added to the axios call.
๐คNish Ganesh
Source:stackexchange.com