{"record":{"id":"e87c091c2bc7fe8d","repo":"vercel/turborepo","slug":"multiple-generators-named-name-found-use-a-q","errorCode":null,"errorMessage":"Multiple generators named \"${name}\" found. Use a qualified name to disambiguate:","messagePattern":"Multiple generators named \"(.+?)\" found\\. Use a qualified name to disambiguate:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/turbo-gen/src/commands/run/prompts.ts","lineNumber":37,"sourceCode":"  if (parsed) {\n    return generators.find(\n      (g): g is Generator =>\n        !(g instanceof Separator) &&\n        g.name === parsed.generator &&\n        g.workspace === parsed.workspace\n    );\n  }\n\n  const matches = generators.filter(\n    (g): g is Generator => !(g instanceof Separator) && g.name === name\n  );\n\n  if (matches.length === 1) {\n    return matches[0];\n  }\n\n  if (matches.length > 1) {\n    logger.warn(\n      `Multiple generators named \"${name}\" found. Use a qualified name to disambiguate:`\n    );\n    for (const m of matches) {\n      logger.item(qualifiedName(m));\n    }\n    logger.log();\n  }\n\n  return undefined;\n}\n\nexport async function customGenerators({\n  generators,\n  generator\n}: {\n  generators: Array<Generator | Separator>;\n  generator?: string;\n}): Promise<{ selectedGenerator: Generator }> {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/packages/turbo-gen/src/commands/run/prompts.ts#L19-L55","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Copy-pasted generator templates in multiple packages without renaming; generators contributed by several teams using generic names like 'util' or 'component'.","solutions":["Re-run with a qualified name from the printed list (e.g. `turbo generate @scope/pkg-name:util`)","Rename one generator's `name` field in its config so short names are unique","Restrict which workspaces are searched via `generator.workspaces` in turbo.json"],"exampleFix":"# before\nturbo generate util   # two generators named 'util'\n\n# after\nturbo generate @acme/shared:util","handlingStrategy":"validation","validationCode":"// Scan generator configs for duplicate short names before invoking\nconst names = generators.map(g => g.name);\nconst dupes = names.filter((n, i) => names.indexOf(n) !== i);\nif (dupes.length) {\n  throw new Error(`ambiguous generator names: ${[...new Set(dupes)].join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Namespace generator names per package (e.g. acme-util, not util)","Use qualified names in CI scripts where the interactive picker cannot be used","Limit generator discovery via turbo.json `generator.workspaces` to packages you actually own"],"tags":["turbo-generate","generators","name-collision"],"backgroundTag":"ambiguous-name-collision","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}