Breakpoints at the startup of a program that is executed via NPM aren't being triggered #1704
Closed
Description
opened on May 11, 2023
Describe the bug
When running a simple Typescript script via a NPM task, breakpoints do not jump at the beginning of the execution. To emphasize this even more, I wrote a very small program that exists pretty quickly, and in it no breakpoint is jumped at all.
I suspect that, because js-debug attaches to child processes via NODE_OPTIONS
injecting of a debugger script, that the script executes too quick for the debugger to actually place the breakpoints.
To Reproduce
The following app.ts
code:
let i = 0
function main() {
console.log("hello world")
}
main()
With the following run configuration:
{
"name": "Example",
"request": "launch",
"runtimeArgs": [
"run-script",
"start"
],
"runtimeExecutable": "npm",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"type": "node",
"console": "integratedTerminal",
},
And from package.json
:
"scripts": {
"start": "node ./out/app.js",
"build": "npx tsc -p ."
},
VS Code Version: VSCode 1.78.1, Plugin: v1.78.0
Activity