nexu-io/open-design · error · Error

--page/--no-deck is not valid with --format pptx

Error message

--page/--no-deck is not valid with --format pptx

What it means

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.

Source

Thrown at apps/daemon/src/export-cli-request.ts:25

  imageFormat?: ExportImageFormat;
  title?: string;
}

export interface ExportCliDeckModeOptions {
  format: ExportFormat;
  deck?: boolean;
  page?: boolean;
  noDeck?: boolean;
}

export function resolveExportCliDeckMode(options: ExportCliDeckModeOptions): boolean | undefined {
  const explicitDeck = options.deck === true;
  const explicitPage = options.page === true || options.noDeck === true;
  if (explicitDeck && explicitPage) {
    throw new Error('--deck cannot be combined with --page or --no-deck');
  }
  if (options.format === "pptx") {
    if (explicitPage) throw new Error('--page/--no-deck is not valid with --format pptx');
    return true;
  }
  if (explicitDeck) return true;
  if (explicitPage) return false;
  return undefined;
}

export function buildExportCliRequestBody(options: ExportCliRequestOptions): Record<string, unknown> {
  const deck = options.format === "pptx" ? true : options.deck;
  return {
    fileName: options.fileName,
    // PPTX is deck-only. For PDF/image, omit `deck` unless the caller explicitly
    // chooses deck/page mode so the daemon can still auto-detect by default.
    ...(deck !== undefined ? { deck } : {}),
    ...(options.format === "image" && options.imageFormat ? { imageFormat: options.imageFormat } : {}),
    ...(options.title ? { title: options.title } : {}),
  };
}

View on GitHub (pinned to 5be4028344)

Solutions

  1. Drop --page / --no-deck when using --format pptx — pptx is always a deck.
  2. If you want a single-page output, use --format pdf or --format image with --page instead.
  3. Make wrapper scripts format-aware so they do not emit page flags for pptx.

Example fix

# before
od export --format pptx --page out.pptx
# after
od export --format pptx out.pptx
Defensive patterns

Strategy: validation

Validate before calling

function validatePptxFlags(format: string, page?: boolean, noDeck?: boolean): string | null {
  if (format === 'pptx' && (page === true || noDeck === true)) {
    return 'PPTX is always a deck; drop --page/--no-deck (use --format pdf for single-page).';
  }
  return null;
}

Try / catch

try {
  resolveExportCliDeckMode(opts);
} catch (err) {
  if (err instanceof Error && /pptx/.test(err.message)) {
    console.error(err.message);
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/103d109708399e85. Report an issue: GitHub.