[Vue Error] Could not proxy request


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 (ECONNREFUSED).


  1. Make sure the config devServer.proxy.target is correct.


devServer: {
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8090`,
  1. Make sure you can visit the backend server anonymous request APIs in your PC, e.g. http://localhost:8090/captchaImage.


The config devServer.proxy.target has no http prefix. e.g. target: localhost:8090.

Or the port number of backend server is not correct.