Skip to content

Commit 95c22ae

Browse files
committed
fix(@angular-devkit/architect): provide better error when builder is not defined
When a builder is not defined a more actionable error message is now displayed. Closes #29226 (cherry picked from commit aa6bf07)
1 parent c822f8f commit 95c22ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/angular_devkit/architect/node/node-modules-architect-host.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ function findProjectTarget(
5555
throw new Error('Project target does not exist.');
5656
}
5757

58+
if (!targetDefinition.builder) {
59+
throw new Error(`A builder is not set for target '${target}' in project '${project}'.`);
60+
}
61+
5862
return targetDefinition;
5963
}
6064

@@ -74,9 +78,9 @@ export class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModu
7478
} else {
7579
this.workspaceHost = {
7680
async getBuilderName(project, target) {
77-
const targetDefinition = findProjectTarget(workspaceOrHost, project, target);
81+
const { builder } = findProjectTarget(workspaceOrHost, project, target);
7882

79-
return targetDefinition.builder;
83+
return builder;
8084
},
8185
async getOptions(project, target, configuration) {
8286
const targetDefinition = findProjectTarget(workspaceOrHost, project, target);

0 commit comments

Comments
 (0)