From 3ebd7ca7caeb266308856f47af06bea641b1f8e8 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:57:05 +0000 Subject: [PATCH] fix(@angular-devkit/architect): improve error message when configuration is missing This commit makes the error message more actionable. Closes #29742 (cherry picked from commit 6f0e90e21581bee6b98f26fd40b1ad1f9bce6386) --- .../node/node-modules-architect-host.ts | 4 +++- .../tests/commands/unknown-configuration.ts | 20 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/angular_devkit/architect/node/node-modules-architect-host.ts b/packages/angular_devkit/architect/node/node-modules-architect-host.ts index 232b6503308e..e01394a22d04 100644 --- a/packages/angular_devkit/architect/node/node-modules-architect-host.ts +++ b/packages/angular_devkit/architect/node/node-modules-architect-host.ts @@ -90,7 +90,9 @@ export class WorkspaceNodeModulesArchitectHost implements ArchitectHost ng('build', '--configuration', 'invalid')); + assert.match( + error.message, + /Configuration 'invalid' for target 'build' in project 'test-project' is not set in the workspace/, + ); }