Node-RED Breakpoints

#1

Hello everyone,
I was talking with a friend about how we can improve the debugging process of developing a Flow using Node-RED and he came with the idea of having breakpoints like the ones we have in the most famous IDEs.
Wouldn't be nice to have such a thing? Specially if we could manipulate the msg during a break event.

#2

Hi Tiago,

I think this is already on the long-term planning. See this Trello item.

Kind regards,
Bart Butenaers

#3

Hi,

although not exactly what you want, this may help you until the mentioned Trello item is implemented:

At our company when developing new nodes or extending existing nodes we debug somehow like this:

  • https://github.com/Microsoft/vscode-recipes/tree/master/nodemon

  • Instead of "attach" I use the following launch.json:

      "version": "0.2.0",
      "configurations": [
          {
              "name": "Launch node-red via nodemon",
              "type": "node",
              "request": "launch",
              "runtimeExecutable": "nodemon",
              "program": "/usr/lib/node_modules/node-red/red.js",
              "restart": true,
              "console": "integratedTerminal",
              "internalConsoleOptions": "neverOpen"
          }
      ]
    
  • find the files of the nodes you are using, open them (or the folder) in vscode.

  • add Breakpoints

  • now when pressing the green arrow for debugging node-red will start via nodemon

  • happy debugging

Best regards
Lars

1 Like