{"record":{"id":"f78a85311727b822","repo":"slidevjs/slidev","slug":"slidev-unsupported-exporting-format-format","errorCode":null,"errorMessage":"[slidev] Unsupported exporting format \"${format}\"","messagePattern":"\\[slidev\\] Unsupported exporting format \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/slidev/node/commands/export.ts","lineNumber":225,"sourceCode":"  const progress = createSlidevProgress(!perSlide)\n  progress.start(pages.length)\n\n  try {\n    if (format === 'pdf') {\n      await genPagePdf()\n    }\n    else if (format === 'png') {\n      await genPagePng(output)\n    }\n    else if (format === 'md') {\n      await genPageMd()\n    }\n    else if (format === 'pptx') {\n      const buffers = await genPagePng(false)\n      await genPagePptx(buffers)\n    }\n    else {\n      throw new Error(`[slidev] Unsupported exporting format \"${format}\"`)\n    }\n  }\n  finally {\n    progress.stop()\n    await browser.close()\n  }\n\n  const relativeOutput = slash(relative('.', output))\n  return relativeOutput.startsWith('.') ? relativeOutput : `./${relativeOutput}`\n\n  async function go(no: number | string, clicks?: string) {\n    const query = new URLSearchParams()\n    if (withClicks)\n      query.set('print', 'clicks')\n    else\n      query.set('print', 'true')\n    if (range)\n      query.set('range', range)","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/slidev/node/commands/export.ts#L207-L243","documentation":"The exporter only supports four output formats: pdf, png, md, pptx. The final else branch catches any other value passed as the format argument.","triggerScenarios":"Passing --format webp, --format jpg, or any unrecognized value to slidev export.","commonSituations":"Typos in the format flag, assuming additional formats (jpg/webp/gif) are supported, copy-pasting a wrong value.","solutions":["Use one of pdf, png, md, or pptx","For other image formats, export png and convert with an external tool"],"exampleFix":"// before\nslidev export --format webp\n// after\nslidev export --format png","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['pdf', 'png', 'md', 'pptx'])\nif (!SUPPORTED.has(format)) throw new Error(`Unsupported format: ${format}. Use one of: ${[...SUPPORTED].join(', ')}`)","typeGuard":"function isExportFormat(f: string): f is 'pdf' | 'png' | 'md' | 'pptx' {\n  return ['pdf', 'png', 'md', 'pptx'].includes(f)\n}","tryCatchPattern":null,"preventionTips":["Restrict the --format flag with a CLI choice validator","Convert to other formats from PNG with an external tool"],"tags":["export","cli","format"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}