{"record":{"id":"4411b8628b4bd079","repo":"santifer/career-ops","slug":"config-profile-yml-not-found-fill-it-in-first","errorCode":null,"errorMessage":"config/profile.yml not found: fill it in first","messagePattern":"config/profile\\.yml not found: fill it in first","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/export-ats-text.mjs","lineNumber":234,"sourceCode":"  let profileRaw = null;\n  const profileSource = customProfilePath || process.env.CAREER_OPS_PROFILE || 'config/profile.yml';\n\n  if (customProfilePath) {\n    if (!existsSync(customProfilePath)) {\n      throw new Error(`Profile configuration file not found at: ${customProfilePath}`);\n    }\n    try {\n      const content = readFileSync(customProfilePath, 'utf8');\n      profileRaw = yaml.load(content);\n      if (!profileRaw || typeof profileRaw !== 'object') {\n        throw new Error(`Invalid YAML in profile file: ${customProfilePath}`);\n      }\n    } catch (err) {\n      throw new Error(`Failed to read profile file at ${customProfilePath}: ${err.message}`);\n    }\n  } else {\n    if (!existsSync(profileSource)) {\n      throw new Error('config/profile.yml not found: fill it in first');\n    }\n    try {\n      const content = readFileSync(profileSource, 'utf8');\n      profileRaw = yaml.load(content);\n      if (!profileRaw || typeof profileRaw !== 'object') {\n        throw new Error('config/profile.yml is empty or invalid YAML: fill it in first');\n      }\n    } catch (err) {\n      throw new Error(`Failed to read profile file at ${profileSource}: ${err.message}`);\n    }\n  }\n\n  let cvData = {};\n  const cvSource = customCvPath || process.env.CAREER_OPS_CV || 'cv.md';\n  if (customCvPath) {\n    if (!existsSync(customCvPath)) {\n      throw new Error(`CV file not found at: ${customCvPath}`);\n    }","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/scripts/export-ats-text.mjs#L216-L252","documentation":"Thrown by loadProfile() when no custom profile path is supplied (customProfilePath is null) and the resolved profile source — customCvPath env CAREER_OPS_PROFILE or the default config/profile.yml — does not exist on disk. This is the standard onboarding error: the library refuses to run with an unfilled profile.","triggerScenarios":"Calling loadProfile() (or loadProfile(null, cvPath)) in a repo where config/profile.yml is missing, or where CAREER_OPS_PROFILE points at a nonexistent file.","commonSituations":"Fresh clone where config/profile.yml was never created from the example template; profile gitignored so CI/containers lack it; wrong working directory; CAREER_OPS_PROFILE env var set to a wrong path.","solutions":["Create config/profile.yml from the example: cp config/profile.example.yml config/profile.yml and fill in name, email, target roles, salary range.","If you meant a custom path, pass it as the first argument to loadProfile() instead of relying on the default.","Check the CAREER_OPS_PROFILE env var — unset it or point it at an existing file.","Run the repo's setup/onboarding (e.g. node doctor.mjs) to detect and fix missing setup files."],"exampleFix":"// before (file missing)\nconst profile = loadProfile();\n// after (shell)\n// cp config/profile.example.yml config/profile.yml && $EDITOR config/profile.yml\n// then\nconst profile = loadProfile();","handlingStrategy":"fallback","validationCode":"import { existsSync } from 'node:fs';\nconst profileSource = process.env.CAREER_OPS_PROFILE || 'config/profile.yml';\nif (!existsSync(profileSource)) {\n  copyFileSync('config/profile.example.yml', 'config/profile.yml'); // then prompt user to edit\n}","typeGuard":null,"tryCatchPattern":"try {\n  const profile = loadProfile();\n} catch (err) {\n  if (/config\\/profile.yml not found/.test(err.message)) {\n    // run onboarding: copy example template and ask user to fill it\n  } else throw err;\n}","preventionTips":["Run the repo's doctor/onboarding check at session start to detect a missing profile.","Create config/profile.yml immediately after cloning (cp config/profile.example.yml config/profile.yml).","If the profile must exist in CI, commit it or generate it in a setup step before running scripts.","Verify the CAREER_OPS_PROFILE env var points at an existing file."],"tags":["config","onboarding","file-not-found"],"backgroundTag":"missing-config-file","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}