All:
I wonder How to signal Node debugger(Node ver: 8.9.4) to rerun the code from Chrome DevTool?
The way I use it is:
If I want to run the app again to back to same breakpoint, currently I have to close the devtool, and repeat step 1-4, I wonder is there anyway I can directly reload and run app.js again in devtool console(just like if you run node inspect app.js
you can use restart
to reload and run)?
Using Google Chrome DevTools to Debug The next step is to head to Chrome, open a new tab, and enter the URL chrome://inspect/ . Click on “Open dedicated DevTools for Node” to start debugging the application. It will take a couple of seconds to view the source code in Chrome DevTools.
Press F5 on the keyboard or click Start Debugging button to launch the Debugger. Launch Chrome. Refresh the page to pause the code at the set breakpoint.
Maybe you can restart the script doing the following steps:
As you can see the app is running and we have values inside the totalOrders variable:
Right click the (annonymous) at the Call Stack, and click "Restart frame":
The script has restarted and the variable is undefined again:
I hope this answer will help someone.
On Chromium 85, Ubuntu 21.10, node.js 14.17.0, after I click on DevTools "Open dedicated DevTools for node", the popup window automatically reconnects whenever I restart the program.
So if I want to restart the program, I can:
node --inspect-brk app.js
commandand after this the debugging process will have restarted from the beginning, with all breakpoints kept.
It is not as ideal as a button on the UI, but at least you don't have to click links on the web UI with the mouse which would be the most painful part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With