1

I have quasar vue fronted which use web-pack dev server running inside docker and I use proxy.js (in main directory) to avoid CORS errors for API requests. However when I send request to API in my browser I see folowing error in terminal (where I run docker container):

[webpack-dev-server] [HPM] Error occurred while proxying request test.my-project.local:3081/auth/login to host.docker.internal:4000/akk [EINVAL] (https://nodejs.org/api/errors.html#errors_common_system_errors)

I use special docker value host.docker.internal for communication with backend (outside container) which is running in localhost:4000. How to fix it?

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345

1 Answers1

1

After few hours on experiments, I reailsed that in proxy.js I have value

target: "host.docker.internal:4000/akk",`

but shoud be

target: "http://host.docker.internal:4000/akk",
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345