-
Notifications
You must be signed in to change notification settings - Fork 61
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
Does not shutdown completely when run from the CLI #104
Comments
That's interesting, as I encountered the same issue (Ctrl-C). never thought that the cause is Can you organize a simple example repo to reproduce? Thanks |
Sure @gilamran I really think You can test this separately with Not always do the
console.log(`Script has started`);
const intervalId = setInterval(() => {
console.log('tick');
}, 1000);
process.on('SIGINT', () => {
clearInterval(intervalId);
console.log(`Script has ended`);
process.exit();
});
process.on('SIGTERM', () => {
clearInterval(intervalId);
console.log(`Script has ended`);
process.exit();
});
{
"compilerOptions": {
"incremental": true,
"target": "ES2020",
"module": "CommonJS",
"strict": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"rootDir": "./src",
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["./src/**/*"],
"exclude": ["./node_modules"]
}
{
"scripts": {
"start": "concurrently --kill-others yarn:watch:*",
"watch:ts": "tsc-watch --onSuccess \"node ./dist\" --noClear",
"watch:tsc": "tsc --watch"
},
"dependencies": {},
"devDependencies": {
"concurrently": "5.3.0",
"tsc-watch": "4.2.9",
"typescript": "4.0.5"
}
}
|
I have been continuing playing with it and sometimes even though I |
Thanks! I'll look into it. |
I did a test (using your example code) and the Ctrl-C did terminate the process (Using SIGINT). |
I'm on Catalina 10..15.7 (the latest one), node 15.1.0, typescript 4.0.5 and tsc-watch 4.2.9. When running It's more noticeable on the |
I'm using the exact same versions, and Ctrl-C just stops the process... I don't see what you're describing... |
Does it work for you to video chat it on Zoom to check it out live? |
how can we do a private chat? |
On GitHub? I didn't know it has that feature. |
I see that you're online... lets do zoom now |
I'm in @gilamran |
Ok, after the Zoom meeting, it appears this issue is occurring only with the Yarn package runner. NPM works fine. |
I've pushed a branch |
It worked on the single script |
I'm experiencing this issue as well, is there a patch? |
Took a peek based on @ajotaos's comment, haven't attempted any fixes:
|
We've had to move away from |
I've very sorry to hear that, maybe you can provide an example to reproduce the issue? |
same problem here. |
@Mujo I'm sorry but I don't understand your reproduction steps... can you give me clear instructions on how to reproduce this? |
Looks like something in most of the projects we use here in work is holding the process. |
I'm facing the same issue using Turborepo. |
Hey all, |
Is anyone can provide a simple reproduction repo.? |
Hi, I can't provide a simple reproduction repo right now, but I think you can reproduce the problem by loading a couple queue system. I think they launch subprocess to run and I think they are not close properly on the reload. The project I'm working use Pubsub and bullmq to handle messaging and task. You could try to run a project that run a lot of bullmq worker (I guess more than 10 should do it). |
Actually |
Is there any update on this issue? |
Do you have a simple way to reproduce this issue? |
@gilamran I don't know if this will help or not, this is the npm script I used. I am using this boilerplate for my project
|
Why are you editing code twice? is that relevant? does that include a save that will trigger a restart? |
I did some tests again, on my (Windows) machine and Ctrl-C terminates the processes. |
@gilamran Hi thanks for testing it again. I edited twice which means, I edited in different lines or pages. Anyway, I think I found the root cause and solved my problem. My issue is not from tsc watch, but from nestsjs configuration when handling multiple database connections. TLDR
The Fix
|
After running
tsc-watch
, on its own, from the CLI and trying to stop it, I'm always requiring an additionalCtrl+C
.Also, when used alongside
concurrently
, theSIGINT
andSIGTERM
is not being passed to the code in theonSuccess
argument.How do I tell
tsc-watch
, when run from the CLI, it should end the process and not remain hanging?The text was updated successfully, but these errors were encountered: