Our team has been doing some development with the new eCommerce. One of the things we had to figure out was how to debug.
To debug client side javascript, you can use Chrome Inspect and dig into the javascript. If you want to debug the server side TypeScript code then you need to do that on a development box. Set your self up, as I assume you already know how to get started with development and you got it to run via yarn start.
Now you can start debugging. Put your breakpoints and be more productive.
In VS Code, install Debugger for Chrome extension.
Call yarn start to run your project
Click on Run > Start Debugging
If it is the first time debugging, then it will auto generate a launch.json file under .vscode folder.
Most of it should be there. Just add the node part of the configuration.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "lanch",
"name": "Launch Program",
"program": "${workspaceFolder}/app.js"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "https://localhost:4000/_sdk/allmodules",
"webRoot": "${workspaceFolder}"
}
]
}