{"record":{"id":"3fc81c61b435c4fb","repo":"santifer/career-ops","slug":"template-not-found-for-kind-kind-name-chosen","errorCode":null,"errorMessage":"Template not found for kind=${kind} name=${chosen} (${fileFor(chosen)})","messagePattern":"Template not found for kind=(.+?) name=(.+?) \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cv-templates.mjs","lineNumber":148,"sourceCode":"    dir = DEFAULT_TEMPLATES_DIR,\n    format = 'html',\n    profilePath = DEFAULT_PROFILE_PATH,\n    fallback = false,\n  } = opts;\n  assertFormat(format);\n\n  const explicit = Boolean(name && String(name).trim());\n  let chosen = kebab(explicit ? name : loadProfileDefault(kind, { profilePath }) || 'standard');\n  const fileFor = (n) => (n === 'standard' ? `${cfg.prefix}.${format}` : `${cfg.prefix}.${n}.${format}`);\n\n  let path = resolve(dir, fileFor(chosen));\n  if (!existsSync(path)) {\n    if (fallback && chosen !== 'standard') {\n      chosen = 'standard';\n      path = resolve(dir, fileFor(chosen));\n    }\n    if (!existsSync(path)) {\n      throw new Error(`Template not found for kind=${kind} name=${chosen} (${fileFor(chosen)})`);\n    }\n  }\n  if (format === 'html') {\n    const v = validateTemplate(path, kind);\n    if (!v.ok) {\n      throw new Error(\n        `Template ${fileFor(chosen)} missing required placeholders: ${v.missing.map((m) => `{{${m}}}`).join(', ')}`\n      );\n    }\n  }\n  return path;\n}\n\n// ---- CLI ----\nconst isMain = process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url);\nif (isMain) {\n  const argv = process.argv.slice(2);\n  const cmd = argv[0];","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/cv-templates.mjs#L130-L166","documentation":"Error \"Template not found for kind=${kind} name=${chosen} (${fileFor(chosen)})\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at cv-templates.mjs:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore the missing template file under templates/ from the repository.","Or pick a template name that exists in templates/.","Re-run node update-system.mjs apply to restore system files."],"exampleFix":"git checkout -- templates/cv-template.html","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}