santifer/career-ops · warning

⚠️ config/profile.yml cv.sections lists

Error message

⚠️  config/profile.yml cv.sections lists "${shown}", which is not a CV section — ignoring it. Recognized: ${CV_SECTION_KEYS.join(', ')}.

What it means

generate-pdf.mjs validates each cv.sections name against CV_SECTION_KEYS. A recognized section must be one of the known keys; anything else cannot be reordered and is ignored with this warning listing the valid keys so the user can correct the name.

Solutions

  1. Replace the invalid name with one from the printed Recognized list (CV_SECTION_KEYS)
  2. If the section exists in your CV under a different title, add an alias to SECTION_ALIASES in generate-pdf.mjs instead of using the raw title
  3. Re-run PDF generation after correcting the key

Example fix

# before: config/profile.yml
cv:
  sections: [Work Experience, skills]
# after
cv:
  sections: [experience, skills]
Defensive patterns

Strategy: validation

Validate before calling

import { CV_SECTION_KEYS } from './generate-pdf.mjs';
const sections = profile.cv?.sections ?? [];
const bad = sections.filter(s => !CV_SECTION_KEYS.includes(s));
if (bad.length) console.warn('unknown section keys:', bad, 'recognized:', CV_SECTION_KEYS);

Type guard

const isKnownSection = (name) => CV_SECTION_KEYS.includes(name);

Prevention

When it happens

Trigger: config/profile.yml `cv.sections` contains a name not present in CV_SECTION_KEYS (e.g. a typo like 'experiance', or a display title like 'Work Experience' instead of the key 'experience'). The check `!CV_SECTION_KEYS.includes(name)` at generate-pdf.mjs:944 fires and the name is skipped.

Common situations: Typo in a section key; using the human-readable heading instead of the internal key; copying section names from a different CV template that uses different keys.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/e9d81cdfdaebc921. Report an issue: GitHub.

Appendix: source

Thrown at generate-pdf.mjs:946

  }

  const chosen = [];
  const unresolved = [];
  const seen = new Set();
  for (const name of order) {
    // `name` comes from a config file and is quoted straight into console
    // output, so it gets the same treatment as a rendered title: displayTitle()
    // strips C0/C1 controls and bidi overrides (either can repaint a terminal
    // line so a warning appears to say something the tool never printed) and
    // bounds the length so one long entry cannot bury the message.
    const shown = displayTitle(name);
    if (seen.has(name)) {
      console.warn(`⚠️  config/profile.yml cv.sections lists "${shown}" more than once — keeping its first position.`);
      continue;
    }
    seen.add(name);
    if (!CV_SECTION_KEYS.includes(name)) {
      console.warn(`⚠️  config/profile.yml cv.sections lists "${shown}", which is not a CV section — ignoring it. Recognized: ${CV_SECTION_KEYS.join(', ')}.`);
      continue;
    }
    const block = byKey.get(name);
    if (block) {
      chosen.push(block);
    } else if (ambiguous.has(name)) {
      // Present, but its markup doesn't stand on its own — it opens or closes
      // elements outside itself, so moving it would leave tags unbalanced.
      // Reported rather than skipped quietly: the section stays where the
      // template put it, and the user would otherwise see a setting that
      // silently does nothing.
      console.warn(`⚠️  config/profile.yml cv.sections lists "${shown}", but this CV's markup does not enclose that section on its own — leaving it in place, because moving it would leave tags unbalanced.`);
    } else {
      // Recognized and unambiguous but with no block. Ordinarily that just means
      // the section isn't in this CV (an optional one with no entries is
      // stripped before the PDF step), which is not worth a warning on its own.
      unresolved.push(name);
    }

View on GitHub (pinned to aac998c7ed)