vercel/turborepo · error · GeneratorError
No config at "${configPath}"
Error message
No config at "${configPath}" What it means
When `turbo gen` is invoked with an explicit --config path, discoverGeneratorConfigs requires that exact file to exist; fs.existsSync failing on it throws GeneratorError `No config at "<configPath>"` (type plop_no_config) before any generator is loaded.
Source
Thrown at packages/turbo-gen/src/utils/plop.ts:69
return undefined;
} finally {
if (bundledConfigPath !== configPath) {
try {
fs.removeSync(bundledConfigPath);
} catch {
// Ignore cleanup failures.
}
}
}
}
function discoverGeneratorConfigs(
project: Project,
configPath?: string
): Array<GeneratorConfig> {
if (configPath) {
if (!fs.existsSync(configPath)) {
throw new GeneratorError(`No config at "${configPath}"`, {
type: "plop_no_config"
});
}
return [{ config: configPath, root: configPath, workspace: "root" }];
}
const configs: Array<GeneratorConfig> = [];
for (const possiblePath of SUPPORTED_ROOT_GENERATOR_CONFIGS) {
const plopFile = path.join(project.paths.root, possiblePath);
if (fs.existsSync(plopFile)) {
configs.push({
config: plopFile,
root: project.paths.root,
workspace: "root"
});
break;
}View on GitHub (pinned to 9f94a7d215)
Solutions
- Verify the file exists as spelled: `ls <configPath>` from the same cwd turbo gen runs in
- Create the config first — e.g. via the generator-setup flow (`turbo gen init` / generating the turbo/generators/config.ts from the embedded template)
- Drop the --config flag and let turbo discover `turbo/generators/config.{ts,js,cjs,mts,mjs}` or a root `plopfile.*` automatically
Example fix
# before turbo gen --config turbo/generators/config.js my-gen # only config.ts exists # after turbo gen --config turbo/generators/config.ts my-gen
Defensive patterns
Strategy: validation
Validate before calling
import fs from 'node:fs';
function configExists(configPath: string): boolean {
return fs.existsSync(configPath);
}
// before turbo gen --config <path>: if (!configExists(path)) fail with a helpful message Try / catch
try {
await runCustomGenerator({ project, generator, configPath });
} catch (err) {
if (err instanceof GeneratorError && err.type === 'plop_no_config') {
// fall back to discovery mode: re-run without configPath and let turbo find turbo/generators/config.*
return runCustomGenerator({ project, generator });
}
throw err;
} Prevention
- Resolve --config to an absolute path before invoking turbo gen so cwd changes cannot break it
- Assert the config file exists in package.json scripts before CI runs the generator
- Prefer relying on auto-discovery (turbo/generators/config.ts / plopfile.ts) over hardcoded paths
When it happens
Trigger: Running `turbo gen --config turbo/generators/config.ts` when that file does not exist: typo in the path, config not created yet, or running from a directory where the relative path resolves elsewhere.
Common situations: Running turbo gen from the wrong working directory during onboarding; renamed or deleted generator configs still referenced by scripts in package.json; CI invoking the command before the config file is generated.
Related errors
- Unable to load generators
- Failed to run generator
- Generator ${qualifiedName(generator)} not found
- Failed to run "${qualifiedName(generator)}" generator
- Unknown template "${templateKey}"
AI-assisted analysis of vercel/turborepo@9f94a7d215 (2026-08-16).
Data as JSON: /api/errors/b92e3226009947c4.
Report an issue: GitHub.