Skip to content

Commit

Permalink
fix(@angular/build): Ctrl + C not terminating dev-server with SSR
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alan-agius4 committed Oct 9, 2024
1 parent 2a1107d commit 549c20a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/angular/build/src/builders/dev-server/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export async function* serveWithVite(
ssrMode = ServerSsrMode.InternalSsrMiddleware;
}

if (browserOptions.progress !== false && ssrMode !== ServerSsrMode.NoSsr) {
// This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`.
process.once('SIGINT', () => {
process.kill(process.pid);
});
}

// Setup server and start listening
const serverConfiguration = await setupServer(
serverOptions,
Expand Down

0 comments on commit 549c20a

Please sign in to comment.