[ECONNREFUSED] Issue

Steps executed:

  1. In One terminal : cd <p_name> followed by daml start
    Sandbox, Json Api… server are up and running

  2. Second terminal: cd <p_name>/ui followed by npm start
    App compiled successfully…
    A login screen opens on port 3030… where on submit getting following error:

Error occurred while proxying request localhost:3000/v1/user to http://localhost:7575/ [ECONNREFUSED] (Errors | Node.js v19.1.0 Documentation)

In the network tab: 504 gateway timeout is coming in response to this api call.

Please help.

Hi @kanika_kapoor,

It seems recent NodeJS versions no longer resolve localhost to 127.0.0.1, and the Node development Server can therefore no longer reach the JSON API, resulting in that error message.

The solution is fairly easy: change the localhost string directly to 127.0.0.1 in the ui/package.json and ui/src/setupProxy.js files (one occurrence in each).

I’ll make sure this fix makes it into the next Daml release.

Thanks