santifer/career-ops · warning

⚠️ config/profile.yml cv.sections lists "${shown}" more tha

Error message

⚠️  config/profile.yml cv.sections lists "${shown}" more than once — keeping its first position.

What it means

While resolving the configured cv.sections order, generate-pdf.mjs tracks each name in a `seen` set. A name listed more than once cannot occupy two positions, so the resolver warns and keeps only its first position (subsequent occurrences are skipped via `continue`).

Source

Thrown at generate-pdf.mjs:778

  const { blocks, ambiguous, unrecognized } = extractSectionBlocks(html);

  const byKey = new Map();
  for (const block of blocks) {
    if (!byKey.has(block.key)) byKey.set(block.key, block);
  }

  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 {

View on GitHub (pinned to 60398d6549)

Solutions

  1. Dedupe cv.sections so every section appears exactly once
  2. Re-run generation and confirm the warning is gone and the order matches intent

Example fix

# before (config/profile.yml)
cv:
  sections: [skills, experience, skills, education]

# after
cv:
  sections: [skills, experience, education]
Defensive patterns

Strategy: validation

Validate before calling

function hasDuplicates(order) {
  return new Set(order).size !== order.length;
}

Prevention

When it happens

Trigger: config/profile.yml cv.sections contains the same canonical key twice, e.g. [skills, education, skills] — the second 'skills' hits `seen.has(name)` and the warning fires; the effective order is [skills, education].

Common situations: Hand-editing the list and duplicating a line; merging two config snippets that each list a popular section like skills; YAML anchors or copy-paste producing a repeated entry.

Related errors


AI-assisted analysis of santifer/career-ops@60398d6549 (2026-08-20). Data as JSON: /api/errors/7f4be5bc91621cf2. Report an issue: GitHub.