{"record":{"id":"b9f95952d7c8ce19","repo":"vercel/turborepo","slug":"failed-to-run-qualifiedname-generator-genera","errorCode":null,"errorMessage":"Failed to run \"${qualifiedName(generator)}\" generator","messagePattern":"Failed to run \"(.+?)\" generator","errorType":"exception","errorClass":"GeneratorError","httpStatus":null,"severity":"error","filePath":"packages/turbo-gen/src/utils/plop.ts","lineNumber":394,"sourceCode":"  const answers = (await gen.runPrompts(bypassArgs)) as Array<unknown>;\n  const results = await gen.runActions(\n    { ...answers, ...injectTurborepoData({ project, generator: gen }) },\n    {\n      onComment: (comment: string) => {\n        logger.dimmed(comment);\n      }\n    }\n  );\n\n  if (results.failures.length > 0) {\n    for (const f of results.failures) {\n      if (f instanceof Error) {\n        logger.error(`Error - ${f.message}`);\n      } else {\n        logger.error(`Error - ${f.error}. Unable to ${f.type} to \"${f.path}\"`);\n      }\n    }\n    throw new GeneratorError(\n      `Failed to run \"${qualifiedName(generator)}\" generator`,\n      { type: \"plop_error_running_generator\" }\n    );\n  }\n\n  if (results.changes.length > 0) {\n    logger.info(\"Changes made:\");\n    for (const c of results.changes) {\n      if (c.path) {\n        logger.item(`${c.path} (${c.type})`);\n      }\n    }\n  }\n}\n","sourceCodeStart":376,"sourceCodeEnd":409,"githubUrl":"https://github.com/vercel/turborepo/blob/9f94a7d215b3881942527dd526afa3fc650869d5/packages/turbo-gen/src/utils/plop.ts#L376-L409","documentation":"Prompts succeeded but one or more plop actions failed during runActions. Each failure is logged first ('Error - <message>' / 'Error - <error>. Unable to <type> to \"<path>\"'), then turbo-gen throws GeneratorError `Failed to run \"<workspace/name>\" generator` (type plop_error_running_generator) to abort the run.","triggerScenarios":"An add/addMany action's templatePath is wrong or its glob matches nothing; a modify action's match pattern no longer occurs in the target file (fails when abortOnFail is set); the destination is not writable; the output file already exists and the config runs with force:false (the default set by createPlopFromConfig).","commonSituations":"Template files renamed/moved without updating paths; source files drifted so modify-action regexes no longer match; re-running a generator whose output files already exist.","solutions":["Read the per-failure lines printed just above the error — they state the action type, target path, and reason","Fix the reported templatePath/glob, or update the modify action's pattern to match the current file content","If re-generating over existing output, delete the previously generated files first (or configure the action with force/overwrite semantics deliberately)","Re-run the generator after each fix; successful runs then print a 'Changes made:' list you can diff"],"exampleFix":"// generator action (before)\n{ type: 'add', path: 'src/{{name}}.tsx', templateFile: './tmpl/comp.hbs' } // moved template\n// after\n{ type: 'add', path: 'src/{{name}}.tsx', templateFile: './templates/component.hbs' }","handlingStrategy":"try-catch","validationCode":"import fs from 'node:fs';\nimport path from 'node:path';\n\nfunction actionsAreRunnable(configDir: string, actions: Array<{ type: string; templateFile?: string; path: string }>): boolean {\n  return actions.every((a) => {\n    if (a.type === 'add' && a.templateFile && !fs.existsSync(path.join(configDir, a.templateFile))) return false;\n    return true;\n  });\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCustomGenerator({ project, generator });\n} catch (err) {\n  if (err instanceof GeneratorError && err.type === 'plop_error_running_generator') {\n    // per-action failures were already logged above the throw — inspect output,\n    // clean up partially generated files, fix templates/patterns, then re-run once\n    logger.warn('generator had failed actions; see per-file errors above');\n  }\n  throw err;\n}","preventionTips":["Keep template paths in sync when moving template files — most failures are stale templateFile references","Delete previously generated output before re-running a generator (it runs with force:false by default)","Keep modify-action patterns tight and covered by tests so source-file drift fails loudly in CI, not mid-generation"],"tags":["turbo-gen","generator","plop","action-failed","templates"],"backgroundTag":"generator-action-failed","analyzedSha":"9f94a7d215b3881942527dd526afa3fc650869d5","analyzedAt":"2026-08-16T19:47:29.531Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}