From 3afd1ab9c0a347950c8477608ad9b81cf75fa891 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 11 Apr 2022 11:21:29 +0200 Subject: [PATCH] fix(@angular-devkit/build-webpack): emit devserver setup errors Closes #22969 --- .../build_webpack/src/webpack-dev-server/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_webpack/src/webpack-dev-server/index.ts b/packages/angular_devkit/build_webpack/src/webpack-dev-server/index.ts index 353536039f9c..43569f916a9e 100644 --- a/packages/angular_devkit/build_webpack/src/webpack-dev-server/index.ts +++ b/packages/angular_devkit/build_webpack/src/webpack-dev-server/index.ts @@ -82,7 +82,13 @@ export function runWebpackDevServer( }); const devServer = createWebpackDevServer(webpackCompiler, devServerConfig); - devServer.startCallback(() => { + devServer.startCallback((err) => { + if (err) { + obs.error(err); + + return; + } + const address = devServer.server?.address(); if (!address) { obs.error(new Error(`Dev-server address info is not defined.`));