[ANNOUNCE] node-red-contrib-inspector: beta

Hi folks,

Oh my god... Doing Node-RED developments already a couple of years, so I always need to start my Node-RED via NodeJs in debug mode. Which allows me to connect to NodeJs via a debugger (e.g. Chrome Developer tools or VSCode or whatever).

However to run NodeJs in debug mode, you need to pass extra startup parameters:

node  --inspect=127.0.0.1  /usr/bin/node-red

But adding such startup parameters isn't very convenient, because you always need to start messing with the default startup commands. E.g. I have spend at the time being quite some time to debug Node-RED in a docker container.

And suddenly last night I though: it is also possible to turn on/off debug mode live in a running Node-RED instance via the NodeJs Inspector API. Which means I have been messing with startup command parameters for nothing all that time :woozy_face:.

Anyway I don't need that anymore because now I can finally use my new node-red-contrib-inspector node :champagne: :clinking_glasses: :partying_face:

As always, all "constructive" feedback is very welcome!!

Bart

7 Likes

Very nice Bart! Should be a really useful addition to the debugging arsenal. Will give it a go when I get a second. I've only ever run debug on my local dev instance, never on my live instance so this should be very useful for that.

For reference, on my dev instance, I simply use an npm script in package.json so I don't need to remember the syntax. My dev instances are only ever manually started (well, via PM2 usually).

1 Like

I have fixed some things:

  1. At startup detect whether the inspector is already running (e.g. when NodeJs has been started with --inspect startup command arguments, or after a redeploy).

  2. After a deploy don't close the inspector, otherwise you need to connect with your debugger again.

For my developments this works fine now, so good enough for now (and for me)...

Version 1.0.1 is now available in the palette:

image

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.