How to add more targets in chrome inspect tab

39 views Asked by At

Im trying to debug the backend repo and i want to use the chrome's debugger. i got to see a video in youtube where i got to know about the --inspect flag while starting the repo i.e.:

node --inspect index.js

Im able to attach break points in this repo and the debugger is working fine.

Now the problem is from this backend repo im making request to one more backend repo that i have started in different port like below

node --inspect=127.0.0.1:9233 index.js

But im not able to see target in chrome inspect tab

chrome://inspect/#devices

im only able to see the first repo on the port 9229 like below enter image description here

So as you can see the above picture there is only the option to inspect only the first backend repo but i want to get the other two repos as well. Currently even after attaching the breakpoints in all the three backend repos its working(stopping at the breakpoints) only for the first repo.

2

There are 2 answers

2
Ararat On BEST ANSWER

You are almost there!

  1. Open chrome://inspect page
  2. Press the button Configure and add the debugger's host and port in the displayed window

target discovery window

0
Gagan On

Found a way to add new target to inspect

  1. Open chrome://inspect page

  2. click on Open dedicated DevTools for Node enter image description here

  3. click on connection tab

  4. click on Add connection and Just add the new port number.

  5. click add button and your done. enter image description here