angular/angular-cli · error
No builder were found for target ${targetStringFromTarget(ta
Error message
No builder were found for target ${targetStringFromTarget(target)}. What it means
The ..getBuilderNameForTarget job handler asks the host which builder executes a target. If the host returns an empty/falsy builder name, this error reports that no builder could be resolved for the target.
Source
Thrown at packages/angular_devkit/architect/src/architect.ts:305
if (options === null) {
throw new Error(`Invalid target: ${JSON.stringify(target)}.`);
}
return options;
});
},
{
name: '..getProjectMetadata',
},
);
}
function _getBuilderNameForTargetFactory(host: ArchitectHost) {
return createJobHandler<Target, never, string>(
async (target) => {
const builderName = await host.getBuilderNameForTarget(target);
if (!builderName) {
throw new Error(`No builder were found for target ${targetStringFromTarget(target)}.`);
}
return builderName;
},
{
name: '..getBuilderNameForTarget',
},
);
}
function _validateOptionsFactory(host: ArchitectHost, registry: json.schema.SchemaRegistry) {
return createJobHandler<[string, json.JsonObject], never, json.JsonObject>(
async ([builderName, options]) => {
// Get option schema from the host.
const builderInfo = await host.resolveBuilder(builderName);
if (!builderInfo) {
throw new Error(`No builder info were found for builder ${JSON.stringify(builderName)}.`);
}View on GitHub (pinned to bb72145f9a)
Solutions
- Open angular.json and ensure the target entry has a "builder": "package:builder" field
- Fix the target/project name (the message shows the resolved target string)
- Re-run `ng generate` or the migration tool to repair a malformed workspace config
- Check the custom ArchitectHost implementation if you supply your own getBuilderNameForTarget
Example fix
// angular.json before
"build": { "options": { ... } }
// after
"build": { "builder": "@angular-devkit/build-angular:browser", "options": { ... } } Defensive patterns
Strategy: validation
Validate before calling
const t = ws.projects?.[target.project]?.architect?.[target.target];
if (!t?.builder) throw new Error(`Target ${target.project}:${target.target} has no builder configured`); Type guard
function hasBuilderConfigured(ws, target) {
return typeof ws?.projects?.[target?.project]?.architect?.[target?.target]?.builder === 'string';
} Try / catch
try {
const builderName = await architect.getBuilderNameForTarget(target);
} catch (e) {
if (e.message.startsWith('No builder were found for target')) {
console.error('Add a "builder" field to the target in angular.json');
}
throw e;
} Prevention
- Never hand-edit angular.json targets without the builder field
- Run `ng build`/`ng lint` on CI to catch malformed workspace configs early
- Use schematics/migrations to modify angular.json instead of manual edits
When it happens
Trigger: Calling architect.getBuilderNameForTarget(target) (or scheduling a target) where angular.json defines the target without a 'builder' field or the host lookup fails.
Common situations: angular.json targets missing the builder key after manual edits or migrations; targets defined only as configurations; custom tooling writing incomplete workspace configs.
Related errors
- Invalid target: ${JSON.stringify(target)}.
- Package "${packageName}" has an invalid builder schema path:
- Builder is not a builder
- Invalid target string:
- Cannot load builder for builderInfo ${JSON.stringify(info, n
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/a2c313c63a0032c2.
Report an issue: GitHub.