vercel/turborepo · error · GeneratorError

Generator ${qualifiedName(generator)} not found

Error message

Generator ${qualifiedName(generator)} not found

What it means

After loading the plop config, turbo-gen looks up the requested generator by name (displayed as `workspace/name`). plop's getGenerator throws (or returns undefined) when no `plop.setGenerator(name, ...)` registered that name, and turbo-gen converts it to GeneratorError `Generator <workspace/name> not found` (type plop_generator_not_found).

Source

Thrown at packages/turbo-gen/src/utils/plop.ts:370

  const destBasePath = configPath ?? generator.destBasePath;

  const plop = await createPlopFromConfig(resolvedConfigPath, destBasePath);

  if (!plop) {
    throw new GeneratorError("Unable to load generators", {
      type: "plop_unable_to_load_config"
    });
  }

  let gen: PlopGenerator | undefined;
  try {
    gen = plop.getGenerator(generator.name) as PlopGenerator | undefined;
  } catch {
    // plop throws when generator not found
  }

  if (!gen) {
    throw new GeneratorError(
      `Generator ${qualifiedName(generator)} not found`,
      { type: "plop_generator_not_found" }
    );
  }

  const answers = (await gen.runPrompts(bypassArgs)) as Array<unknown>;
  const results = await gen.runActions(
    { ...answers, ...injectTurborepoData({ project, generator: gen }) },
    {
      onComment: (comment: string) => {
        logger.dimmed(comment);
      }
    }
  );

  if (results.failures.length > 0) {
    for (const f of results.failures) {
      if (f instanceof Error) {

View on GitHub (pinned to 9f94a7d215)

Solutions

  1. List what is actually available: run `turbo gen` with no name — it shows discovered generators grouped by workspace as `workspace/name`
  2. Compare the exact name against your `plop.setGenerator('<name>', ...)` call, including casing
  3. Ensure you run from (or target via --config) the workspace whose config defines the generator

Example fix

// turbo/generators/config.ts
plop.setGenerator('widget', { ... });
# before
turbo gen widgt
# after
turbo gen widget
Defensive patterns

Strategy: validation

Validate before calling

import { getCustomGenerators } from './plop';

async function generatorExists(project: Project, name: string): Promise<boolean> {
  const gens = await getCustomGenerators({ project });
  return gens.some(
    (g) => !(g instanceof Separator) && `${(g as Generator).workspace}/${(g as Generator).name}` === name
  );
}

Type guard

function isKnownGeneratorName(name: string, registered: string[]): boolean {
  return registered.includes(name);
}

Try / catch

try {
  await runCustomGenerator({ project, generator });
} catch (err) {
  if (err instanceof GeneratorError && err.type === 'plop_generator_not_found') {
    // list available generators so the user can correct the name
    const available = await listGenerators(project);
    throw new Error(`unknown generator — available: ${available.join(', ')}`);
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `turbo gen my-generator` when the loaded config never registers that name; a typo or casing mismatch (plop names are case-sensitive); running with a --config that defines different generators; invoking a workspace-qualified name (`web/build`) for a workspace whose config lacks it.

Common situations: Renaming generators without updating docs/scripts; running from a different workspace than the one defining the generator; CI scripts referencing a generator deleted in a refactor.

Related errors


AI-assisted analysis of vercel/turborepo@9f94a7d215 (2026-08-16). Data as JSON: /api/errors/ceb17895264fcddd. Report an issue: GitHub.