Skip to content

Commit 804cc3b

Browse files
authored
fix: check pid is undefined before kill it (#2646)
1 parent 52bb94c commit 804cc3b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/cuddly-cougars-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/dts-plugin': patch
3+
---
4+
5+
fix: check pid is undefined before kill it

packages/dts-plugin/src/core/lib/DtsWorker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export class DtsWorker {
4545
const ensureChildProcessExit = () => {
4646
try {
4747
const pid = this.rpcWorker.process?.pid;
48-
process.kill(pid, 0);
48+
const rootPid = process.pid;
49+
if (pid && rootPid !== pid) {
50+
process.kill(pid, 0);
51+
}
4952
} catch (error) {
5053
if (isDebugMode()) {
5154
console.error(error);

0 commit comments

Comments
 (0)