I know this has been asked/stated a million times, but I just can't get this working and VSCode Github directed me here for questions (as I assume this is not a bug but rather my ineptitude).
I am running an Express app using the GOV.UK Prototype Kit. I want to debug my app using Visual Code (on Mac OS) and have followed numerous guides to do so, but all seem to have the same result...
- Start my app using
npm start --inspect - I have a launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"protocol": "inspector"
}
]
}
- Attach the debugger from VS Code. All seems good based on the following output:
Debugger listening on ws://127.0.0.1:9229/a601df80-c84c-49e3-b1bc-9a128ad28c49
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Subsequently, I can use breakpoints in my start.js file, but not in any of my main app code such as ./app/views/x/something.js. If I set a breakpoint in something.js then the breakpoint turns to a grey circle (hovering tells me that the breakpoint is unverified) and is never triggered.
Apologies for asking this question when so many others have already but I just can't get it working. Thanks in advance.