3.14 Debugging via Chrome Dev Tools

This time, we are learning how to debug through Chrome.

You must have Chrome installed to continue.

We use the same material from 3.13.

We used node inspect to enter the debug mode in the command interface. For chrome, we use node --inspect-brk

If we do this, we will see

$ node --inspect-brk playground/debugging.js
Debugger listening on ws://
For help see https://nodejs.org/en/docs/inspector

Now, connect via Chrome.

Alt text

Alt text

Alt text

Use nodemon with Chrome Debugging

$ nodemon --inspect-brk playground/debugging.js

Create Debugger in Chrome Dev

Alt text


var logNote = (note) => {
// Break on this line and use Chrome to print note
console.log(`Title: ${note.title}`);
console.log(`Body: ${note.body}`);