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

  1. Verify the file exists as spelled: `ls <configPath>` from the same cwd turbo gen runs in
  2. Create the config first — e.g. via the generator-setup flow (`turbo gen init` / generating the turbo/generators/config.ts from the embedded template)
  3. 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

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


AI-assisted analysis of vercel/turborepo@9f94a7d215 (2026-08-16). Data as JSON: /api/errors/b92e3226009947c4. Report an issue: GitHub.