Search code examples
node.jsdebuggingbackendchrome-debugging

How to add more targets in chrome inspect tab


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.


Solution

  • 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