{"record":{"id":"103d109708399e85","repo":"nexu-io/open-design","slug":"page-no-deck-is-not-valid-with-format-pptx","errorCode":null,"errorMessage":"--page/--no-deck is not valid with --format pptx","messagePattern":"--page/--no-deck is not valid with --format pptx","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/export-cli-request.ts","lineNumber":25,"sourceCode":"  imageFormat?: ExportImageFormat;\n  title?: string;\n}\n\nexport interface ExportCliDeckModeOptions {\n  format: ExportFormat;\n  deck?: boolean;\n  page?: boolean;\n  noDeck?: boolean;\n}\n\nexport function resolveExportCliDeckMode(options: ExportCliDeckModeOptions): boolean | undefined {\n  const explicitDeck = options.deck === true;\n  const explicitPage = options.page === true || options.noDeck === true;\n  if (explicitDeck && explicitPage) {\n    throw new Error('--deck cannot be combined with --page or --no-deck');\n  }\n  if (options.format === \"pptx\") {\n    if (explicitPage) throw new Error('--page/--no-deck is not valid with --format pptx');\n    return true;\n  }\n  if (explicitDeck) return true;\n  if (explicitPage) return false;\n  return undefined;\n}\n\nexport function buildExportCliRequestBody(options: ExportCliRequestOptions): Record<string, unknown> {\n  const deck = options.format === \"pptx\" ? true : options.deck;\n  return {\n    fileName: options.fileName,\n    // PPTX is deck-only. For PDF/image, omit `deck` unless the caller explicitly\n    // chooses deck/page mode so the daemon can still auto-detect by default.\n    ...(deck !== undefined ? { deck } : {}),\n    ...(options.format === \"image\" && options.imageFormat ? { imageFormat: options.imageFormat } : {}),\n    ...(options.title ? { title: options.title } : {}),\n  };\n}","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/export-cli-request.ts#L7-L43","documentation":"Plain Error thrown by resolveExportCliDeckMode when the caller requests --page or --no-deck while also selecting --format pptx. PPTX is fundamentally a slide-deck format, so page-mode is meaningless for it; the function hard-codes deck:true for pptx and refuses the contradictory page flag rather than silently ignoring it.","triggerScenarios":"Any export invocation combining format:'pptx' with page:true or noDeck:true. E.g. `od export --format pptx --page out.pptx` or `od export --format pptx --no-deck out.pptx`. Note --deck with pptx is fine (it just returns true); only the page-family flags conflict.","commonSituations":"User copying a PDF export command and swapping only --format to pptx, leaving --page in place; a script that always emits --page regardless of format; misunderstanding that pptx is always deck-shaped.","solutions":["Drop --page / --no-deck when using --format pptx — pptx is always a deck.","If you want a single-page output, use --format pdf or --format image with --page instead.","Make wrapper scripts format-aware so they do not emit page flags for pptx."],"exampleFix":"# before\nod export --format pptx --page out.pptx\n# after\nod export --format pptx out.pptx","handlingStrategy":"validation","validationCode":"function validatePptxFlags(format: string, page?: boolean, noDeck?: boolean): string | null {\n  if (format === 'pptx' && (page === true || noDeck === true)) {\n    return 'PPTX is always a deck; drop --page/--no-deck (use --format pdf for single-page).';\n  }\n  return null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  resolveExportCliDeckMode(opts);\n} catch (err) {\n  if (err instanceof Error && /pptx/.test(err.message)) {\n    console.error(err.message);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Never combine --page/--no-deck with --format pptx.","Make wrapper scripts format-aware so page flags only emit for pdf/image.","Use --format pdf --page when single-page output is the goal."],"tags":["cli","validation","export","argument-conflict","pptx"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}