vercel/turborepo · warning

Multiple generators named "${name}" found. Use a qualified n

Error message

Multiple generators named "${name}" found. Use a qualified name to disambiguate:

What it means

turbo-gen resolves a generator passed by name (`turbo generate <name>`) by filtering discovered generator configs on their short name. When more than one config shares that name it cannot pick one automatically, prints this warning listing each candidate's qualified name, and returns undefined so the interactive selector is shown instead.

Source

Thrown at packages/turbo-gen/src/commands/run/prompts.ts:37

  if (parsed) {
    return generators.find(
      (g): g is Generator =>
        !(g instanceof Separator) &&
        g.name === parsed.generator &&
        g.workspace === parsed.workspace
    );
  }

  const matches = generators.filter(
    (g): g is Generator => !(g instanceof Separator) && g.name === name
  );

  if (matches.length === 1) {
    return matches[0];
  }

  if (matches.length > 1) {
    logger.warn(
      `Multiple generators named "${name}" found. Use a qualified name to disambiguate:`
    );
    for (const m of matches) {
      logger.item(qualifiedName(m));
    }
    logger.log();
  }

  return undefined;
}

export async function customGenerators({
  generators,
  generator
}: {
  generators: Array<Generator | Separator>;
  generator?: string;
}): Promise<{ selectedGenerator: Generator }> {

View on GitHub (pinned to f9245100cf)

Solutions

  1. Re-run with a qualified name from the printed list (e.g. `turbo generate @scope/pkg-name:util`)
  2. Rename one generator's `name` field in its config so short names are unique
  3. Restrict which workspaces are searched via `generator.workspaces` in turbo.json

Example fix

# before
turbo generate util   # two generators named 'util'

# after
turbo generate @acme/shared:util
Defensive patterns

Strategy: validation

Validate before calling

// Scan generator configs for duplicate short names before invoking
const names = generators.map(g => g.name);
const dupes = names.filter((n, i) => names.indexOf(n) !== i);
if (dupes.length) {
  throw new Error(`ambiguous generator names: ${[...new Set(dupes)].join(', ')}`);
}

Prevention

When it happens

Trigger: `turbo generate <name>` where at least two discovered generator configs across the repository's workspaces have the same `name` field, so matches.length > 1 and no unique selection is possible.

Common situations: Copy-pasted generator templates in multiple packages without renaming; generators contributed by several teams using generic names like 'util' or 'component'.

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/e87c091c2bc7fe8d. Report an issue: GitHub.