Skip to content

Commit

Permalink
fix(dev): forcibly kill app server during dev (remix-run#6197)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Apr 26, 2023
1 parent 6aa3381 commit b739bba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/soft-laws-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

forcibly kill app server during dev
5 changes: 4 additions & 1 deletion packages/remix-dev/devServer_unstable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,8 @@ let kill = async (p?: execa.ExecaChildProcess) => {
await execa("taskkill", ["/pid", String(p.pid), "/f", "/t"]);
return;
}
p.kill();

// wait one tick of the event loop so that we guarantee app server gets killed before proceeding
p.kill("SIGTERM", { forceKillAfterTimeout: 0 });
await new Promise((resolve) => setTimeout(resolve, 0));
};

0 comments on commit b739bba

Please sign in to comment.