Skip to content

Commit aa6bf07

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
1 parent a0b4ea2 commit aa6bf07

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: 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)