{"record":{"id":"1ffd91505a25d43b","repo":"santifer/career-ops","slug":"could-not-parse-config-profile-yml-err-message","errorCode":null,"errorMessage":"⚠️   Could not parse config/profile.yml: ${err.message}","messagePattern":"⚠️   Could not parse config/profile\\.yml: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gemini-eval.mjs","lineNumber":130,"sourceCode":"      if (rel.startsWith('..') || isAbsolute(customModesDir)) {\n        console.warn(`⚠️   modes_dir \"${customModesDir}\" escapes project root; using default modes/`);\n      } else {\n        if (existsSync(dirPath)) {\n          const candidateFiles = ['oferta.md', 'angebot.md', 'offre.md', 'kyujin.md', 'is-ilani.md', 'naukri.md'];\n          const found = candidateFiles.find((file) => existsSync(join(dirPath, file)));\n          if (found) {\n            modesDir = customModesDir;\n            evalFilename = found;\n          } else {\n            console.warn(`⚠️   No matching evaluation file found in ${customModesDir}; using default modes/oferta.md`);\n          }\n        } else {\n          console.warn(`⚠️   modes_dir \"${customModesDir}\" not found; using default modes/`);\n        }\n      }\n    }\n  } catch (err) {\n    console.warn(`⚠️   Could not parse config/profile.yml: ${err.message}`);\n  }\n}\n\nPATHS.shared = join(CODE_ROOT, modesDir, '_shared.md');\nPATHS.oferta = join(CODE_ROOT, modesDir, evalFilename);\n\n// ---------------------------------------------------------------------------\n// CLI argument parsing\n// ---------------------------------------------------------------------------\nconst args = process.argv.slice(2);\n\nif (args.length === 0 || args[0] === '--help' || args[0] === '-h') {\n  console.log(`\n╔══════════════════════════════════════════════════════════════════╗\n║           career-ops — Gemini Evaluator (free-tier)             ║\n╚══════════════════════════════════════════════════════════════════╝\n\n  Evaluate a job offer using Google Gemini instead of Claude.","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/gemini-eval.mjs#L112-L148","documentation":"gemini-eval.mjs wraps its config/profile.yml load (yaml.load) in a try/catch; when parsing or reading the file throws — invalid YAML syntax, wrong top-level types, or an unreadable file — this warning reports err.message and the language/modes_dir resolution is skipped entirely, leaving PATHS.shared and PATHS.oferta pointed at the default modes/. The evaluation continues with defaults; the profile's language settings are ignored for this run.","triggerScenarios":"config/profile.yml contains malformed YAML (bad indentation, tabs, unquoted special characters like ':' or '#' in values, duplicate keys in strict mode) or cannot be read (missing read permission); also thrown if yaml.load returns unexpected types that break property access inside the guarded block.","commonSituations":"Hand-editing profile.yml and breaking indentation or leaving a value like `modes_dir: modes/de #comment` with an odd character; pasting YAML from a doc with tabs instead of spaces; a partially written file after an interrupted edit; Windows line-ending or BOM issues in the file.","solutions":["Run a YAML linter on config/profile.yml (`npx yaml-lint config/profile.yml` or paste into a YAML validator) to find the exact syntax error named in err.message.","Fix the reported line — most often replace tabs with spaces, quote values containing ':' or '#', and correct indentation to consistent 2-space steps.","If the file is beyond repair, restore from config/profile.example.yml and re-apply your settings, keeping valid YAML.","Re-run the evaluation and confirm the warning no longer appears and the intended modes_dir is picked up."],"exampleFix":"# before (config/profile.yml — invalid YAML, tab indentation)\nlanguage:\n\toutput: de\n\tmodes_dir: modes/de\n\n# after\nlanguage:\n  output: de\n  modes_dir: modes/de","handlingStrategy":"try-catch","validationCode":"import { readFileSync } from 'node:fs';\nimport { parse } from 'yaml';\ntry {\n  parse(readFileSync('config/profile.yml', 'utf8'));\n  console.log('config/profile.yml is valid YAML');\n} catch (err) {\n  console.error(`config/profile.yml invalid: ${err.message}`);\n  process.exitCode = 1;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const profile = yaml.load(readFileSync('config/profile.yml', 'utf8'));\n  // proceed\n} catch (err) {\n  console.warn(`Could not parse config/profile.yml: ${err.message}`);\n  // fall back to defaults, and surface the message to the user so the file gets fixed\n}","preventionTips":["Lint config/profile.yml with a YAML validator after every manual edit (2-space indentation, no tabs, quote values containing ':' or '#').","Restore from config/profile.example.yml after a corrupted edit and re-apply changes incrementally.","Commit a known-good profile to git so bad edits can be reverted with `git diff config/profile.yml`.","Watch for the 'Could not parse config/profile.yml' warning in output — it silently disables all language/market settings."],"tags":["yaml","config","parse-error","fallback"],"backgroundTag":"yaml-parse-error","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"}