Debugging Node.js pipeline processes

I have a command that looks basically like this:

node --inspect-brk=9229 a.js | node --inspect-brk=54031 b.js

When I run this command on the command line, I get the following:

Debugger listening on ws://127.0.0.1:54031/66c60348-ce22-4acc-9ba3-aa97b8dd1f12
For help see https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:9229/59c70b31-8af6-4c99-bdaf-c1a86f49d62b
For help see https://nodejs.org/en/docs/inspector

They are hard-coded to listen on different ports, one by default (9229) and the other on 54031.

However, when I debug Chrome tools, only one Chrome debug window opens, and when I try to use different URLs, I cannot open a second debug session.

The url that works looks like this:

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9229/59c70b31-8af6-4c99-bdaf-c1a86f49d62b

and if I try to paste this into a new window:

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws://127.0.0.1:54031/66c60348-ce22-4acc-9ba3-aa97b8dd1f12

he does not work

+4
source share
1 answer

Change

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws://127.0.0.1:54031/66c60348-ce22-4acc-9ba3-aa97b8dd1f12

to

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:54031/66c60348-ce22-4acc-9ba3-aa97b8dd1f12

true&ws:// before true&ws=

I tried this too, and his work was wonderful.

+2
source

Source: https://habr.com/ru/post/1690500/


All Articles