5

I'm working on a Node.js project and it was working perfectly (friday around 3pm). I opened the same project this morning and the debugger of chrome isn't working anymore with my node --inspect command.

node --inspect server.js

It tells me it created a websocket where I can connect to. I can connect manualy with this websocket by using the standard ws url by chrome:

chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/{{YOUR_KEY}}

But this means I can't connect when I'm reloading my app. It is also not showing on the chrome://inspect#devices page

Im running the latest version of node (10.15). I've tested this on canary and the chromium browser. Canary has the same problem but on chromium it seems to be working fine.

Did chrome release a new update? How can I solve this problem and open my debugger!?

Edit

I can open the node develop tools now but it doesn't respond with my code. It looks like it is trying to connect but then fails and tries to reconnect again. The dev tools is also creating a session with my express app every second or so. The chromium way is only working for a single app and the websocket doesn't reconnect, this means I have to open my app every time I make a change in my code.

Dennis Spierenburg
  • 613
  • 2
  • 6
  • 16
  • I found this problem is a chrome issue, version 73. Downgrading your chrome version will help – Dennis Spierenburg Mar 25 '19 at 13:28
  • 1
    Possible duplicate of [Chrome 73: Can no longer debug NodeJS with Dedicated DevTools for Node](https://stackoverflow.com/questions/55143498/chrome-73-can-no-longer-debug-nodejs-with-dedicated-devtools-for-node) – Dennis Spierenburg Mar 25 '19 at 13:30
  • For others landing here: From my personal experience I really recommend using `ndb` (https://github.com/GoogleChromeLabs/ndb) – at least as temporary workaround for this bug (https://bugs.chromium.org/p/chromium/issues/detail?id=941608). Downgrading Chrome is not officially supported and thus one needs to rely on third-party downloads. And it might mess up your Chrome userdata. – Neonit Apr 03 '19 at 12:47
  • 1
    Using the NiM Chromium extension as detailed in this blog post: https://blog.june07.com/nim-custom-devtools-url/ allows you to keep Chrome at the most recent version. https://june07.com/nim. – user7656831 Apr 08 '19 at 03:44

2 Answers2

0

Please check the port on which your node application is running.

--inspect Listen on default address and port (127.0.0.1:9229)

Use, --inspect=[host:port] if you want to use any other port

https://nodejs.org/en/docs/guides/debugging-getting-started/

Anupam Chaplot
  • 1,134
  • 1
  • 9
  • 22
0

on express, using the binary file along with the --inspect flag worked for me...

$ nodemon --exec node --inspect ./bin/www
betoharres
  • 1,736
  • 2
  • 19
  • 25