[Vue Error] Could not proxy request
Background
Calling backend API, the status code of the response is 500, but the backend is not throw exceptions. The HTTP response message is “Proxy error: Could not proxy request”.
Error Info
Proxy error: Could not proxy request /captchaImage from localhost:8070 to http://10.0.0.74:8090 (ECONNREFUSED). |
Solutions
- Make sure the config
devServer.proxy.target
is correct.
vue.config.js
devServer: { |
- Make sure you can visit the backend server anonymous request APIs in your PC, e.g.
http://localhost:8090/captchaImage
.
Reasons
The config devServer.proxy.target
has no http prefix. e.g. target: localhost:8090
.
Or the port number of backend server is not correct.