vercel/turborepo · error · GeneratorError
plop_generator_not_found
plop_generator_not_found
Error message
Generator ${qualifiedName(generator)} not found What it means
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.
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 f9245100cf)
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
Example fix
// before: command and registration disagree
turbo gen component // plopfile: plop.setGenerator("Component", ...)
// after: names match
turbo gen Component // or rename to plop.setGenerator("component", ...) Defensive patterns
Strategy: validation
Validate before calling
// list registered generator names before invoking one by name
import nodePlop from "node-plop";
const plop = await nodePlop(configPath, { destBasePath: root });
const names = plop.getGeneratorList().map((g) => g.name);
if (!names.includes(requestedName)) {
throw new Error(`Generator ${requestedName} not found. Available: ${names.join(", ")}`);
} Type guard
function isKnownGenerator(name: string, known: string[]): boolean {
return known.includes(name);
} Try / catch
try {
await runPlopGenerator(args);
} catch (err) {
if (err instanceof GeneratorError && err.type === "plop_generator_not_found") {
// surface the interactive list so the user can pick a valid name
console.error("Unknown generator. Run `turbo gen` with no arguments to list them.");
} else {
throw err;
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- plop_no_config
- plop_error_running_generator
- Workspace "${override}" not found
- New workspace root detected - unexpected 'workspaces' field
- New workspace is missing a package.json file
AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17).
Data as JSON: /api/errors/63ba24ee7c5d79f5.
Report an issue: GitHub.