santifer/career-ops · error · Error

Unsupported profile photo style

Error message

Unsupported profile photo style: ${style} (expected rounded, circle, or square)

What it means

Config validation in the CV HTML builder: the candidate's photo_style (or photoStyle) field is not one of the three supported values in PHOTO_STYLES — rounded, circle, or square. The guard runs before any HTML is generated, so nothing renders until the style is corrected.

Solutions

  1. Set photo_style to "rounded", "circle", or "square" in the candidate data / profile
  2. Remove photo_style entirely to fall back to the default ("rounded")
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at build-cv-html.mjs:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at build-cv-html.mjs:122

  }
  return escapeHtml(url);
}

function sanitizeImageSrc(src) {
  if (typeof src !== 'string') return '';
  const value = src.trim();
  if (IMAGE_DATA_URL_RE.test(value)) return escapeHtml(value);
  if (/^https?:\/\//i.test(value)) return sanitizeUrl(value);
  return '';
}

async function prepareCandidatePhoto(candidate) {
  const c = candidate && typeof candidate === 'object' ? { ...candidate } : {};
  const photo = typeof c.photo === 'string' ? c.photo.trim() : '';
  const style = c.photo_style || c.photoStyle || 'rounded';

  if (!PHOTO_STYLES.has(style)) {
    throw new Error(`Unsupported profile photo style: ${style} (expected rounded, circle, or square)`);
  }
  c.photo_style = style;
  if (!photo) {
    c.photo = '';
    return c;
  }

  if (photo.startsWith('data:')) {
    if (!IMAGE_DATA_URL_RE.test(photo)) {
      throw new Error('Unsupported profile photo data URL (expected base64 PNG, JPEG, WebP, or GIF)');
    }
    c.photo = photo;
    return c;
  }

  if (/^https?:\/\//i.test(photo)) {
    c.photo = photo;
    return c;

View on GitHub (pinned to e7abd431fc)