{"record":{"id":"b92e3226009947c4","repo":"vercel/turborepo","slug":"no-config-at-configpath","errorCode":null,"errorMessage":"No config at \"${configPath}\"","messagePattern":"No config at \"(.+?)\"","errorType":"exception","errorClass":"GeneratorError","httpStatus":null,"severity":"error","filePath":"packages/turbo-gen/src/utils/plop.ts","lineNumber":69,"sourceCode":"    return undefined;\n  } finally {\n    if (bundledConfigPath !== configPath) {\n      try {\n        fs.removeSync(bundledConfigPath);\n      } catch {\n        // Ignore cleanup failures.\n      }\n    }\n  }\n}\n\nfunction discoverGeneratorConfigs(\n  project: Project,\n  configPath?: string\n): Array<GeneratorConfig> {\n  if (configPath) {\n    if (!fs.existsSync(configPath)) {\n      throw new GeneratorError(`No config at \"${configPath}\"`, {\n        type: \"plop_no_config\"\n      });\n    }\n    return [{ config: configPath, root: configPath, workspace: \"root\" }];\n  }\n\n  const configs: Array<GeneratorConfig> = [];\n\n  for (const possiblePath of SUPPORTED_ROOT_GENERATOR_CONFIGS) {\n    const plopFile = path.join(project.paths.root, possiblePath);\n    if (fs.existsSync(plopFile)) {\n      configs.push({\n        config: plopFile,\n        root: project.paths.root,\n        workspace: \"root\"\n      });\n      break;\n    }","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/vercel/turborepo/blob/9f94a7d215b3881942527dd526afa3fc650869d5/packages/turbo-gen/src/utils/plop.ts#L51-L87","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nturbo gen --config turbo/generators/config.js my-gen   # only config.ts exists\n# after\nturbo gen --config turbo/generators/config.ts my-gen","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\n\nfunction configExists(configPath: string): boolean {\n  return fs.existsSync(configPath);\n}\n// before turbo gen --config <path>: if (!configExists(path)) fail with a helpful message","typeGuard":null,"tryCatchPattern":"try {\n  await runCustomGenerator({ project, generator, configPath });\n} catch (err) {\n  if (err instanceof GeneratorError && err.type === 'plop_no_config') {\n    // fall back to discovery mode: re-run without configPath and let turbo find turbo/generators/config.*\n    return runCustomGenerator({ project, generator });\n  }\n  throw err;\n}","preventionTips":["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"],"tags":["turbo-gen","generator","config","plop","file-not-found"],"backgroundTag":"config-file-not-found","analyzedSha":"9f94a7d215b3881942527dd526afa3fc650869d5","analyzedAt":"2026-08-16T19:47:29.531Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}