You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Regression] Debugging of typescript node apps has been broken #40430
Your launch config is wrong (and it was only working in previous versions of VS Code because of bug #16173).
The problem is that you are passing all arguments via the "runtimeArgs" attribute. This makes it difficult for VS Code to insert the "--inspect-brk" argument it the right location.
Instead you should only pass nodemon arguments via "runtimeArgs", then use the "program" attribute for your "real" program and then the "real" arguments through the "args" attribute.
(So if you remove the "runtimeExecutable" and "runtimeArgs" attributes from the launch config, then you should end up with a launch config that runs your program without nodemon.)
E.g.:
Andre Weinand (@weinand) Thanks for the explanation. I've tried the suggested debug configuration. Unfortunately I've got the following error message on both 1.18.1 and 1.20.0:
Cannot launch program 'c:\Dev\node-typescript-vscode\src\index.ts' because corresponding JavaScript cannot be found.
There's no outFiles and as far as I understand specifying them doesn't make sense. Of course if I specify outFiles as an empty array I get:
Cannot launch program 'c:\Dev\node-typescript-vscode\src\index.ts' because corresponding JavaScript cannot be found.
You do not seem to have an explicit build task that transpiles TS to JS.
The ts-node seems to be the tool that transpiles in your case.
That means VS Code cannot really know where the generated JS lives.
But since ts-node takes care of it, VS Code does not really has to know.
Remove the "program" attribute and insert the "${workspaceRoot}/src/index.ts" as the first argument of the "args" attribute just before "--project".
Activity
weinand commentedon Dec 18, 2017
Your launch config is wrong (and it was only working in previous versions of VS Code because of bug #16173).
The problem is that you are passing all arguments via the "runtimeArgs" attribute. This makes it difficult for VS Code to insert the "--inspect-brk" argument it the right location.
Instead you should only pass nodemon arguments via "runtimeArgs", then use the "program" attribute for your "real" program and then the "real" arguments through the "args" attribute.
(So if you remove the "runtimeExecutable" and "runtimeArgs" attributes from the launch config, then you should end up with a launch config that runs your program without nodemon.)
E.g.:
This launch config should work on all versions of VS Code so you can try it with 1.18.1 and if it works you can safely upgrade to 1.19.
Let me know if this works.
Deilan commentedon Dec 18, 2017
Andre Weinand (@weinand) Thanks for the explanation. I've tried the suggested debug configuration. Unfortunately I've got the following error message on both 1.18.1 and 1.20.0:
There's no
outFilesand as far as I understand specifying them doesn't make sense. Of course if I specifyoutFilesas an empty array I get:weinand commentedon Dec 18, 2017
You do not seem to have an explicit build task that transpiles TS to JS.
The
ts-nodeseems to be the tool that transpiles in your case.That means VS Code cannot really know where the generated JS lives.
But since
ts-nodetakes care of it, VS Code does not really has to know.Remove the "program" attribute and insert the "${workspaceRoot}/src/index.ts" as the first argument of the "args" attribute just before "--project".
Deilan commentedon Dec 18, 2017
Yep, that worked. 1.18.1, 1.19.0 and 1.20.0. Thanks Andre Weinand (@weinand)!