NicolasPetton / Indium

A JavaScript development environment for Emacs
https://indium.readthedocs.io
GNU General Public License v3.0
1.13k stars 61 forks source link

Indium server error: connect ECONNREFUSED ::1:9229 #270

Closed mihaiolteanu closed 2 years ago

mihaiolteanu commented 2 years ago

The same question that has been asked a thousand times (here and here)

I have a minimal index.js,

console.log("Hello");

From the command line, I start node,

> node --inspect-brk index.js
Debugger listening on ws://127.0.0.1:9229/932276c6-0a76-4bbd-81b6-4b6166dd8678
For help, see: https://nodejs.org/en/docs/inspector

I have .indium.json along my index.js,

> ls -a
.  ..  .indium.json  index.js

The config either has the format suggested in the documentation,

{
    "configurations": [
        {
            "name": "MyConfig",
            "type": "node",
            "program": "node",
            "args": "./index.js",
            "inspect-brk": true
        }
    ]
}

or the one suggested in one of the issues,

{
  "configurations": [
    {
      "name": "Web project",
      "type": "node",
      "command": "node ./index.js",
      "port": 9229
    }
  ]
}

I now call indium-connect and get

Indium server error: connect ECONNREFUSED ::1:9229

I've tried tweaking the .indium.json file to no avail. I get the same results with indium-launch.\ I'm otherwise using the Chromium debugging successfully.

mihaiolteanu commented 2 years ago

I've managed to make it work with the following .indium.json that specifies the host and port exactly as received upon starting the node app on the cmdline (see above),


{
    "configurations": [
        {
            "name": "MyConfig",
            "type": "node",
            "program": "node",
            "args": "./index.js",
            "inspect-brk": true,
            "host": "127.0.0.1",
            "port": "9229"
        }
    ]
}