Profound.js Debugging with Chrome DevTools

 

This page explains how to debug Profound.js programs using Google Chrome's built-in debugger. For debugging Profound.js Spaces programs, see here.

 

In order to debug a node process you must start that process with debug enabled.

To enable you must run node using 2 switches: --inspect --no-worker 

1) node --inspect start --no-worker

In this terminal, or within the log file, it will show you which port it has a listener connected to:

$ node --inspect start --no-worker Debugger listening on ws://127.0.0.1:9229/62dcef4a-a7cb-4a18-9f12-f7fb15e40363 For help, see: https://nodejs.org/en/docs/inspector Profound.js server version 4.13.1 running at http://0.0.0.0:8081/ Node.js version is v10.15.0

2) Open a new Chrome Browser Tab and navigate to chrome://inspect

3) Click the "Open dedicated DevTools for Node" link.

This will open a new popup window.  This is the debugging app.

4) On the connection tab, if you do not see your connection (address:port) in the list, you should add it now.

In the above example, you would add: 127.0.0.1:9229.

As soon as you do this, back on that terminal, or log file, you will see a new line that says: Debugger attached.

5) Now you can go and run your module.

When the node process gets to loading your module, it would then show up in the Debuggers Sources tab.

6) You now you can add breakpoints, look at fields, change their values, etc.



Debugging Profound.js with Chrome Devtools - Video