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

  1. Open angular.json and ensure the target entry has a "builder": "package:builder" field
  2. Fix the target/project name (the message shows the resolved target string)
  3. Re-run `ng generate` or the migration tool to repair a malformed workspace config
  4. 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

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


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/a2c313c63a0032c2. Report an issue: GitHub.