Debugging
Debugging from web browser
- If you want to debug your client-side JS code from your web browser (e.g. Chrome), modify your JS code and add a
debugger;
statement. - Start your app and open your web browser
- Open dev tools (
F12
if Chrome) - Browse to the area where you expect the debugger statement to catch
Debugging from Visual Studio Code
- Switch to the
Debug
tab, and open the configuration json settings
Sample configuration for starting the app in debug mode Debug myApp
, or start unit tests in debug mode Debug Unit Tests
...
{
"type": "node",
"request": "launch",
"name": "Debug myApp",
"program": "${workspaceRoot}\\scripts\\start.js"
},
{
"type": "node",
"request": "launch",
"name": "Debug Unit Tests",
"program": "${workspaceRoot}\\scripts\\testUnit.js"
}