{"record":{"id":"63ba24ee7c5d79f5","repo":"vercel/turborepo","slug":"plop-generator-not-found","errorCode":"plop_generator_not_found","errorMessage":"Generator ${qualifiedName(generator)} not found","messagePattern":"Generator (.+?) not found","errorType":"exception","errorClass":"GeneratorError","httpStatus":null,"severity":"error","filePath":"packages/turbo-gen/src/utils/plop.ts","lineNumber":370,"sourceCode":"  const destBasePath = configPath ?? generator.destBasePath;\n\n  const plop = await createPlopFromConfig(resolvedConfigPath, destBasePath);\n\n  if (!plop) {\n    throw new GeneratorError(\"Unable to load generators\", {\n      type: \"plop_unable_to_load_config\"\n    });\n  }\n\n  let gen: PlopGenerator | undefined;\n  try {\n    gen = plop.getGenerator(generator.name) as PlopGenerator | undefined;\n  } catch {\n    // plop throws when generator not found\n  }\n\n  if (!gen) {\n    throw new GeneratorError(\n      `Generator ${qualifiedName(generator)} not found`,\n      { type: \"plop_generator_not_found\" }\n    );\n  }\n\n  const answers = (await gen.runPrompts(bypassArgs)) as Array<unknown>;\n  const results = await gen.runActions(\n    { ...answers, ...injectTurborepoData({ project, generator: gen }) },\n    {\n      onComment: (comment: string) => {\n        logger.dimmed(comment);\n      }\n    }\n  );\n\n  if (results.failures.length > 0) {\n    for (const f of results.failures) {\n      if (f instanceof Error) {","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/packages/turbo-gen/src/utils/plop.ts#L352-L388","documentation":"After loading a plop config, turbo-gen looks up the generator by the name you selected or passed. plop.getGenerator throws when no generator with that name is registered. The code swallows that throw and throws this GeneratorError with code plop_generator_not_found when the lookup yields no generator.","triggerScenarios":"You run turbo gen <name> and the loaded config never calls plop.setGenerator with that exact name. A rename in the plopfile leaves old names in scripts or docs. Multiple config files exist and the name lives in a different one than the one loaded.","commonSituations":"Name casing or spelling mismatch, such as component versus Component. The plopfile was edited and the generator was renamed or removed. The --config flag loads a smaller config that lacks the generator.","solutions":["Run turbo gen with no name to see the interactive list of generators the config exposes","Open the loaded plopfile and check the exact string in plop.setGenerator(\"...\"","Fix either the command argument or the setGenerator name so both match exactly","Confirm --config points to the config file that registers the generator you want"],"exampleFix":"// before: command and registration disagree\nturbo gen component   // plopfile: plop.setGenerator(\"Component\", ...)\n// after: names match\nturbo gen Component   // or rename to plop.setGenerator(\"component\", ...)","handlingStrategy":"validation","validationCode":"// list registered generator names before invoking one by name\nimport nodePlop from \"node-plop\";\n\nconst plop = await nodePlop(configPath, { destBasePath: root });\nconst names = plop.getGeneratorList().map((g) => g.name);\nif (!names.includes(requestedName)) {\n  throw new Error(`Generator ${requestedName} not found. Available: ${names.join(\", \")}`);\n}","typeGuard":"function isKnownGenerator(name: string, known: string[]): boolean {\n  return known.includes(name);\n}","tryCatchPattern":"try {\n  await runPlopGenerator(args);\n} catch (err) {\n  if (err instanceof GeneratorError && err.type === \"plop_generator_not_found\") {\n    // surface the interactive list so the user can pick a valid name\n    console.error(\"Unknown generator. Run `turbo gen` with no arguments to list them.\");\n  } else {\n    throw err;\n  }\n}","preventionTips":["Keep generator names stable and documented in your repository","Run turbo gen interactively to see the exact generator names available","Update scripts whenever a plopfile renames or removes a generator"],"tags":["turbo-gen","plop","generator","not-found","cli"],"backgroundTag":"generator-name-not-found","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}