{"record":{"id":"c24378b4760ee1ac","repo":"vercel/turborepo","slug":"plop-no-config","errorCode":"plop_no_config","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/f9245100cf0d31d96628804ead485f6bf226e55a/packages/turbo-gen/src/utils/plop.ts#L51-L87","documentation":"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.","triggerScenarios":"Thrown at packages/turbo-gen/src/utils/plop.ts:69 when the library encounters an invalid state.","commonSituations":"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.","solutions":["Verify the file exists: ls <configPath> from the same directory where you run turbo gen","Pass an absolute path to remove cwd ambiguity","Check the extension matches one of the supported ones (ts, js, cjs, mts, mjs)","Omit --config so turbo gen discovers turbo/generators/config.* or plopfile.* automatically"],"exampleFix":"# before: relative path, wrong cwd\nnpm exec turbo gen -- --config turbo/generators/config.ts\n# after: absolute path\nnpm exec turbo gen -- --config /repo/turbo/generators/config.ts","handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\nimport path from \"node:path\";\n\n// resolve --config against the monorepo root and confirm it exists before running\nconst resolved = path.isAbsolute(configPath) ? configPath : path.resolve(process.cwd(), configPath);\nif (!fs.existsSync(resolved)) {\n  throw new Error(`No config at \"${resolved}\"`);\n}","typeGuard":"function isSupportedConfigFile(p: string): boolean {\n  return /\\.(ts|js|cjs|mts|mjs)$/.test(p) && fs.existsSync(p);\n}","tryCatchPattern":null,"preventionTips":["Pass absolute config paths in scripts to avoid cwd-dependent behavior","Use supported extensions: ts, js, cjs, mts, mjs","Let turbo gen auto-discover turbo/generators/config.* when possible"],"tags":["turbo-gen","plop","config","path","cli"],"backgroundTag":"config-file-not-found","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}