{"record":{"id":"0ad2bdf92a932c4c","repo":"santifer/career-ops","slug":"profile-photo-is-empty-photo","errorCode":null,"errorMessage":"Profile photo is empty: ${photo}","messagePattern":"Profile photo is empty: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"build-cv-html.mjs","lineNumber":152,"sourceCode":"\n  if (/^[a-z][a-z0-9+.-]+:/i.test(photo)) {\n    throw new Error(`Unsupported profile photo URL scheme: ${photo.split(':', 1)[0]}`);\n  }\n\n  const photoPath = isAbsolute(photo) ? photo : resolve(__dirname, photo);\n  const mime = PHOTO_MIME_BY_EXT.get(extname(photoPath).toLowerCase());\n  if (!mime) {\n    throw new Error(`Unsupported profile photo format: ${photo} (expected PNG, JPEG, WebP, or GIF)`);\n  }\n\n  let bytes;\n  try {\n    bytes = await readFile(photoPath);\n  } catch (err) {\n    throw new Error(`Profile photo not found or unreadable: ${photo} (${err.code || err.message})`);\n  }\n  if (bytes.length === 0) {\n    throw new Error(`Profile photo is empty: ${photo}`);\n  }\n  c.photo = `data:${mime};base64,${bytes.toString('base64')}`;\n  return c;\n}\n\nfunction joinItems(items) {\n  if (Array.isArray(items)) return items.join(', ');\n  return typeof items === 'string' ? items : '';\n}\n\n// ── Section partials (#2183) ────────────────────────────────────────────────\n//\n// Resolve the sections/ directory co-located with a given template file.\n// For \"templates/cv-template.html\" this is \"templates/sections/\".\n// For a custom pack at \"templates/cv-template.compact.html\" we look for\n// \"templates/sections/\" first (shared by all templates in that directory),\n// then fall back to the built-in builders.\n//","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/build-cv-html.mjs#L134-L170","documentation":"Error \"Profile photo is empty: ${photo}\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at build-cv-html.mjs:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace the profile photo file — it is 0 bytes.","Re-download or re-export the photo and update the path in the profile config."],"exampleFix":"cp ~/Pictures/headshot.png assets/headshot.png","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}