angular/angular-cli · error

Could not find the implementation for builder

Error message

Could not find the implementation for builder 

What it means

A manifest entry for a builder must specify an 'implementation' path (the JS module implementing the builder). resolveBuilder throws when the entry lacks one, so no builder function could be loaded.

Source

Thrown at packages/angular_devkit/architect/node/node-modules-architect-host.ts:193

    // Attempt to locate an entry for the specified builder by name
    const builder = buildersManifest.builders?.[builderName];
    if (!builder) {
      throw new Error(`Cannot find builder ${JSON.stringify(builderStr)}.`);
    }

    // Resolve alias reference if entry is a string
    if (typeof builder === 'string') {
      return this.resolveBuilder(
        builder,
        path.dirname(packageJsonPath),
        (seenBuilders ?? new Set()).add(builderStr),
      );
    }

    // Determine builder implementation path (relative within package only)
    const implementationPath = builder.implementation && path.normalize(builder.implementation);
    if (!implementationPath) {
      throw new Error('Could not find the implementation for builder ' + builderStr);
    }
    if (path.isAbsolute(implementationPath) || implementationPath.startsWith('..')) {
      throw new Error(
        `Package "${packageName}" has an invalid builder implementation path: "${builderName}" --> "${builder.implementation}"`,
      );
    }

    // Determine builder option schema path (relative within package only)
    let schemaPath = builder.schema;
    if (!schemaPath) {
      throw new Error('Could not find the schema for builder ' + builderStr);
    }
    if (path.isAbsolute(schemaPath) || path.normalize(schemaPath).startsWith('..')) {
      throw new Error(
        `Package "${packageName}" has an invalid builder schema path: "${builderName}" --> "${builder.schema}"`,
      );
    }

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Add the 'implementation' field pointing to the builder's JS module in the builders.json entry.
  2. Publish a corrected version of the builder package.
  3. Use a different builder that is fully defined.

Example fix

// before (builders.json)
"my-builder": {"schema": "./schema.json"}
// after
"my-builder": {"implementation": "./my-builder.impl", "schema": "./schema.json"}
Defensive patterns

Strategy: validation

Validate before calling

const entry = require(`${packageName}/builders.json`).builders?.[builderName];
if (typeof entry === 'object' && !entry.implementation) throw new Error(`Builder "${packageName}:${builderName}" is missing an implementation path.`);

Type guard

const hasImplementation = (b) => typeof b === 'object' && b !== null && typeof b.implementation === 'string' && b.implementation.length > 0;

Try / catch

try { await host.resolveBuilder(builderStr); } catch (e) { if (String(e.message).includes('Could not find the implementation for builder')) { /* fix the manifest entry's 'implementation' field */ } else throw e; }

Prevention

When it happens

Trigger: A builders.json entry like {"schema": "./schema.json"} with no 'implementation' key, and code resolves that builder.

Common situations: Authoring a custom builder and forgetting the implementation field; a manifest entry left partially written; string alias chains resolving to an incomplete object entry.

Related errors


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