Contents
  1. 1. Background
  2. 2. Error Info
  3. 3. Solutions
  4. 4. Reasons

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

1
Proxy error: Could not proxy request /captchaImage from localhost:8070 to http://10.0.0.74:8090 (ECONNREFUSED).

Solutions

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

vue.config.js

1
2
3
4
5
6
7
8
9
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.

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.

Contents
  1. 1. Background
  2. 2. Error Info
  3. 3. Solutions
  4. 4. Reasons