We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8784c00 commit 1647b1cCopy full SHA for 1647b1c
1 file changed
packages/cli-v3/src/mcp/tools/devServer.ts
@@ -86,9 +86,10 @@ export const startDevServerTool = {
86
});
87
88
// Stream output in the background
89
+ const myProcess = devProcess;
90
const readOutput = async () => {
91
try {
- for await (const line of devProcess!) {
92
+ for await (const line of myProcess) {
93
const clean = stripAnsi(line);
94
pushLog(clean);
95
@@ -104,8 +105,12 @@ export const startDevServerTool = {
104
105
// Process ended
106
}
107
- // When the process exits
108
- const exitCode = devProcess?.exitCode;
+ // Only update module state if no new server has been started since
109
+ if (devProcess !== myProcess) {
110
+ return;
111
+ }
112
+
113
+ const exitCode = myProcess.exitCode;
114
if (devState !== "error") {
115
devState = "stopped";
116
0 commit comments