0

Node-inspector is a fantastic tool for debugging server-side code just as one would use the Chrome developer tools. I'm using it to debug a Meteor server, as in https://stackoverflow.com/a/19438774/586086.

One thing that would be even better would be to be able to use the debugging console to inspect objects while the app is running, without pausing it, as allowed by the Chrome developer tools. Currently, if one tries to do this without pausing, the following type of error is displayed:

enter image description here

It seems that there should be a way to replicate the client-side debugging functionality that Chrome has, by inserting the inspection code into the Node event loop, instead of pausing to do it. Does anyone know if this is possible?

Community
  • 1
  • 1
Andrew Mao
  • 35,740
  • 23
  • 143
  • 224

1 Answers1

2

Disclaimer: I am the maintainer of Node Inspector.

The V8 debugger protocol used by Node Inspector does not support inspecting objects while the program is running. (Well, it allows you to inspect an object, but you can't inspect the result of the inspection.) Chrome Developer Tools apply a workaround, they are injecting their custom javascript code into the web page and using this injected code to perform inspections.

It should be possible to inject the same code from Node Inspector and rewrite Node Inspector inspections to call the injected code instead of using the V8 debugger protocol. The change is probably not too difficult, but it still requires a decent amount of time.

If you like to contribute this feature, I am happy to help you. Please open a github issue to discuss implementation details.

Miroslav Bajtoš
  • 10,667
  • 1
  • 41
  • 99
  • Great, thanks for explaining. I'll definitely take you up on that offer at some point in the future if someone else hasn't already. – Andrew Mao Mar 17 '14 at 21:29