santifer/career-ops · error · Error
Profile photo is empty
Error message
Profile photo is empty: ${photo} What it means
Post-read emptiness check in the CV HTML builder: the photo file was found and read successfully but contains zero bytes, so there is no image data to embed. Usually a truncated download, an empty placeholder file, or a git-LFS pointer that never resolved.
Solutions
- Replace the empty file with a real image
- Re-download or re-export the photo
- If using git-LFS, ensure the binary was actually pulled (git lfs pull)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at build-cv-html.mjs:160 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/0ad2bdf92a932c4c.
Report an issue: GitHub.
Appendix: source
Thrown at build-cv-html.mjs:160
if (/^[a-z][a-z0-9+.-]+:/i.test(photo)) {
throw new Error(`Unsupported profile photo URL scheme: ${photo.split(':', 1)[0]}`);
}
const photoPath = isAbsolute(photo) ? photo : resolve(__dirname, photo);
const mime = PHOTO_MIME_BY_EXT.get(extname(photoPath).toLowerCase());
if (!mime) {
throw new Error(`Unsupported profile photo format: ${photo} (expected PNG, JPEG, WebP, or GIF)`);
}
let bytes;
try {
bytes = await readFile(photoPath);
} catch (err) {
throw new Error(`Profile photo not found or unreadable: ${photo} (${err.code || err.message})`);
}
if (bytes.length === 0) {
throw new Error(`Profile photo is empty: ${photo}`);
}
c.photo = `data:${mime};base64,${bytes.toString('base64')}`;
return c;
}
function joinItems(items) {
if (Array.isArray(items)) return items.join(', ');
return typeof items === 'string' ? items : '';
}
// ── Section partials (#2183) ────────────────────────────────────────────────
//
// Resolve the sections/ directory co-located with a given template file.
// For "templates/cv-template.html" this is "templates/sections/".
// For a custom pack at "templates/cv-template.compact.html" we look for
// "templates/sections/" first (shared by all templates in that directory),
// then fall back to the built-in builders.
//View on GitHub (pinned to e7abd431fc)