vercel/turborepo · error · GeneratorError

plop_no_config

plop_no_config

Error message

No config at "${configPath}"

What it means

turbo gen accepts an explicit --config path to one generator config file. discoverGeneratorConfigs checks that path with fs.existsSync before using it. It throws this GeneratorError with code plop_no_config when no file exists at the exact path given. The path is used as-is, so relative paths resolve from your current working directory, not the monorepo root.

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 f9245100cf)

Solutions

  1. Verify the file exists: ls <configPath> from the same directory where you run turbo gen
  2. Pass an absolute path to remove cwd ambiguity
  3. Check the extension matches one of the supported ones (ts, js, cjs, mts, mjs)
  4. Omit --config so turbo gen discovers turbo/generators/config.* or plopfile.* automatically

Example fix

# before: relative path, wrong cwd
npm exec turbo gen -- --config turbo/generators/config.ts
# after: absolute path
npm exec turbo gen -- --config /repo/turbo/generators/config.ts
Defensive patterns

Strategy: validation

Validate before calling

import fs from "node:fs";
import path from "node:path";

// resolve --config against the monorepo root and confirm it exists before running
const resolved = path.isAbsolute(configPath) ? configPath : path.resolve(process.cwd(), configPath);
if (!fs.existsSync(resolved)) {
  throw new Error(`No config at "${resolved}"`);
}

Type guard

function isSupportedConfigFile(p: string): boolean {
  return /\.(ts|js|cjs|mts|mjs)$/.test(p) && fs.existsSync(p);
}

Prevention

When it happens

Trigger: Thrown at packages/turbo-gen/src/utils/plop.ts:69 when the library encounters an invalid state.

Common situations: Typo in the config file name. A relative path that works from the repo root but not from a package directory. Wrong file extension, such as plopfile.ts versus config.ts. Running turbo gen from a different cwd.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/c24378b4760ee1ac. Report an issue: GitHub.