Skip to content

Commit 549c20a

Browse files
committed
fix(@angular/build): Ctrl + C not terminating dev-server with SSR
This commit provides a workaround for #28336, which occurs due to the interaction between `zone.js` and `listr2`. The issue prevents proper termination of the development server using Ctrl + C when dev-server. Closes: #28336
1 parent 2a1107d commit 549c20a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/angular/build/src/builders/dev-server/vite-server.ts

+7
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ export async function* serveWithVite(
334334
ssrMode = ServerSsrMode.InternalSsrMiddleware;
335335
}
336336

337+
if (browserOptions.progress !== false && ssrMode !== ServerSsrMode.NoSsr) {
338+
// This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`.
339+
process.once('SIGINT', () => {
340+
process.kill(process.pid);
341+
});
342+
}
343+
337344
// Setup server and start listening
338345
const serverConfiguration = await setupServer(
339346
serverOptions,

0 commit comments

Comments
 (0)