When I use ts-node to debug my program, breakpoints can still paused the program,but that line are not highlighted and the variable and watch side menu is empty.
I Just tried compile ts file to js and debug it with source map,it worked.
Here is my vs code launch config
{
// worked
"type": "node",
"request": "launch",
"name": "Launch compiled",
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"program": "${workspaceFolder}/a.ts",
"runtimeArgs": ["--nolazy"],
"sourceMaps": true
},
{
// doesn't work
"type": "node",
"request": "launch",
"name": "Launch TS",
"runtimeArgs": [
"-r",
"ts-node/register"],
"args": [
"${workspaceFolder}/a.ts"
],
"cwd": "${workspaceFolder}",
"protocol": "inspector",
"sourceMaps": true
},

Seems to be related to https://github.com/Microsoft/vscode/issues/68616 issue. Try disabling smartStep:
{
// doesn't work
"type": "node",
"request": "launch",
"name": "Launch TS",
"runtimeArgs": [
"-r",
"ts-node/register"],
"args": [
"${workspaceFolder}/a.ts"
],
"cwd": "${workspaceFolder}",
"protocol": "inspector",
"sourceMaps": true,
"smartStep": false,
},
Closing because it looks like the suggestion to disable smartStep has solved the problem. If you have debugger issues, please feel free to comment here, open a new issue, or ask for advice on the TypeScript Community Discord.
Most helpful comment
Seems to be related to https://github.com/Microsoft/vscode/issues/68616 issue. Try disabling
smartStep: