diff --git a/.changeset/soft-laws-cry.md b/.changeset/soft-laws-cry.md new file mode 100644 index 00000000000..e67e057df4d --- /dev/null +++ b/.changeset/soft-laws-cry.md @@ -0,0 +1,5 @@ +--- +"@remix-run/dev": patch +--- + +forcibly kill app server during dev diff --git a/packages/remix-dev/devServer_unstable/index.ts b/packages/remix-dev/devServer_unstable/index.ts index 44d57abb23e..822f58500d1 100644 --- a/packages/remix-dev/devServer_unstable/index.ts +++ b/packages/remix-dev/devServer_unstable/index.ts @@ -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)); };