santifer/career-ops · error · Error
Unsupported template format: ${format} (expected html or tex
Error message
Unsupported template format: ${format} (expected html or tex) What it means
Error "Unsupported template format: ${format} (expected html or tex)" thrown in santifer/career-ops.
Source
Thrown at cv-templates.mjs:52
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(' ');
}
export function kebab(display) {
return String(display)
.trim()
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '');
}
// The only template formats the resolver recognizes. `format` reaches path
// construction (fileFor) unmodified, so it must be allowlisted or a value like
// `--format=../../etc/passwd` would traverse out of the templates dir.
const VALID_FORMATS = new Set(['html', 'tex']);
function assertFormat(format) {
if (!VALID_FORMATS.has(format)) {
throw new Error(`Unsupported template format: ${format} (expected html or tex)`);
}
}
// filename → {name, format} | null. Base "cv-template.html" → name "standard";
// "cv-template.<name>.html" → that name. Only html/tex are recognized.
function parseFilename(prefix, file) {
const m = file.match(new RegExp(`^${prefix}(?:\\.([a-z0-9-]+))?\\.(html|tex)$`));
if (!m) return null;
return { name: m[1] || 'standard', format: m[2] };
}
export function parseMeta(path) {
let text;
try {
text = readFileSync(path, 'utf-8');
} catch {
return {};
}View on GitHub (pinned to 9b17a8ac97)
Solutions
- Use html or tex as the template format.
Example fix
node generate-pdf.mjs --format html
When it happens
Trigger: Thrown at cv-templates.mjs:52 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13).
Data as JSON: /api/errors/47826fd00e34c472.
Report an issue: GitHub.