-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js debug: New process is being created after each debugger restart #28108
Comments
@Deilan can you stil reproduce this with latest vscode inisders from here |
I was able to @isidorn. I read it as a feature request to reuse the previously launched external terminal. I have no idea if we're actually able to do that or not. |
Shouldn't the launched Node process be killed once debugging has been stopped? |
Fowarding to @weinand since he did the external temrinal support in vscode and might know if there is already a issue capturing the request to always reuse the previously launched external terminal. |
For recent versions of VS Code the launch config must be slightly modified (and can be simplified): {
"name": "Launch via nodemon",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/nodemon",
"runtimeArgs": [
"--exitcrash",
"--exec",
"${workspaceRoot}/node_modules/.bin/ts-node",
],
"args": [
"${workspaceRoot}/src/index.ts"
],
"restart": true,
"console": "externalTerminal"
} In addition change index.ts to this: import { Greeter } from "./greeter";
const greeter = new Greeter<string>("Hello, world");
setInterval(() => {
// tslint:disable-next-line:no-console
console.log(greeter.greet());
}, 1000); With the "setInterval" instead of "setTimeout" the program keeps running (which makes more sense in a nodemon setup). With this, the setup works fine for me on macOS and Windows 10. |
I have a
nodemon
withts-node
, which watch for changes in TypeScript code and recompile every time it happens. In.vscode/launch.json
I set"request": "launch"
andconsole: "externalTerminal"
and start debug. Everytime I change code a new process starts while the previous is still currently active. Figure:Repro:
git clone https://github.com/Deilan/node-typescript-vscode.git
(Web)npm i
launch.json
's contents with the contents below.Launch via nodemon
debug configuration../src/index.ts
in any wayExpect:
The process continue execution and debugger reconnects to it.
OR
The process finishes and debugger create a new process and connects to it.
(I'm not yet sure what is more correct by design)
Actual:
The process continues exection, debugger launches a new process and connects to it.
.vscode/launch.json
:The text was updated successfully, but these errors were encountered: