I'm trying to debug my typescript NodeJs application in VS Code with the following launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/apps/file-server-app/app.ts",
"outFiles": [
"${workspaceFolder}/build/**/*.js"
],
"runtimeArgs": [
"--require",
"ts-node/register"
]
}
]
}
The application starts fine and everything works as it should except the breakpoints. Instead of stopping on the actual line I placed the breakpoint in the Typescript code, it breaks on the line in the compiled Javascript equivalent.
Things I've tried:
Additional information:
VSCode Version: 1.46.1
TypeScript Version: 3.8.3
Turns out this is intended in the design of VS Code.
To fix it, you can either:
outFiles in your launch.json to an empty array so that sourcemaps are not discovered and the path redirection doesn't happen.See this github issue for more details: https://github.com/microsoft/vscode/issues/101927
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