nexu-io/open-design · error · Error

slide ${index + 1} has no file path

Error message

slide ${index + 1} has no file path

What it means

Thrown by readSlideFiles() (the file-path variant of slide ingestion) when one of the paths the desktop renderer handed back is not a non-empty string — i.e. undefined, null, a number, or '' at that array index. ${index} is 0-based, so the message reports the 1-based slide number. It surfaces a malformed renderer response as an export failure rather than a silent skip or a corrupt file.

Source

Thrown at apps/daemon/src/deck-export.ts:109

}

/**
 * Decodes the `data:image/(png|jpeg);base64,...` URLs the desktop renderer
 * returns into raw image buffers tagged with their format. Rejects anything that
 * is not a base64 PNG/JPEG data URL so a malformed renderer response surfaces as
 * an export failure rather than a corrupt file.
 */
/**
 * Reads the image files the desktop renderer wrote (the `outputDir` handoff)
 * into raw buffers tagged with their format (by extension). The companion to
 * {@link decodeSlideDataUrls} for the file-path path, which avoids shuttling
 * base64 image bytes through the JSON IPC channel for large images.
 */
export async function readSlideFiles(paths: string[]): Promise<SlideImage[]> {
  return Promise.all(
    paths.map(async (filePath, index) => {
      if (typeof filePath !== 'string' || filePath.length === 0) {
        throw new Error(`slide ${index + 1} has no file path`);
      }
      const buffer = await readFile(filePath);
      return { buffer, jpeg: /\.jpe?g$/i.test(filePath) };
    }),
  );
}

export function decodeSlideDataUrls(urls: string[]): SlideImage[] {
  return urls.map((url, index) => {
    const match = /^data:image\/(png|jpeg);base64,([A-Za-z0-9+/=]+)$/.exec(url ?? '');
    if (!match) {
      throw new Error(`slide ${index + 1} is not a base64 PNG/JPEG data URL`);
    }
    return { buffer: Buffer.from(match[2] ?? '', 'base64'), jpeg: match[1] === 'jpeg' };
  });
}

// Standard PowerPoint 16:9 slide is 13.333" x 7.5". We keep 13.333" as the slide

View on GitHub (pinned to 5be4028344)

Solutions

  1. Re-run the render so every slide produces a file path; retry export once the desktop renderer reports all slides complete.
  2. Filter or pad the paths array only if missing slides are genuinely intentional (rare) — normally the export should fail loudly, which is what this error does.
  3. Check the desktop renderer logs for the failing slide (the index in the message points at it) and fix the render-side cause.

Example fix

// before: passing the renderer array straight through
const images = await readSlideFiles(renderOutput.paths);

// after: assert every slide produced a path before reading
if (renderOutput.paths.some(p => typeof p !== 'string' || p.length === 0)) {
  throw new Error('render returned an incomplete slide set');
}
const images = await readSlideFiles(renderOutput.paths);
Defensive patterns

Strategy: validation

Validate before calling

function assertAllPathsPresent(paths: unknown[]) {
  paths.forEach((p, i) => {
    if (typeof p !== 'string' || p.length === 0) {
      throw new Error(`slide ${i + 1} has no file path`);
    }
  });
}

Type guard

function allSlidePathsValid(paths: unknown[]): paths is string[] {
  return paths.every(p => typeof p === 'string' && p.length > 0);
}

Try / catch

try { await readSlideFiles(paths); }
catch (e) {
  if (e instanceof Error && /has no file path/.test(e.message)) {
    // re-render the missing slide, then retry
  } else throw e;
}

Prevention

When it happens

Trigger: The desktop renderer's outputDir handoff returned an array where one entry is missing/empty — e.g. a slide failed to render and produced no file, or the IPC payload was assembled with a hole.

Common situations: Renderer crashed on one slide and returned '' for it; partial render where some slides were skipped; an array length mismatch between requested and rendered slides; race where the renderer reported paths before all files were written.

Related errors


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