Export download debugging

From nexu-io/open-design · View interactive version

Export download debugging is an AI agent skill from the GitHub repository nexu-io/open-design. Diagnose and fix browser, preview, or Electron export/download failures, especially image export issues involving Save As, Blob/Data URLs, the File System Access API, createWritable failures, and 0 KB files.

How to use this skill

Skill file

Export Download Debugging

Use this when an export or download appears to run but produces an empty,

missing, or unusable file. It is tuned for browser previews, iframe capture,

and Electron shells.

Core rule

Separate capture from save. Prove the export payload has non-zero bytes before

debugging the destination path. A 0 KB file often means the native picker or

host created the target file, then the write failed or was blocked.

Evidence

and thrown error name/message.

createWritable, <a download>, URL.createObjectURL, and URL revocation.

save dialog filters, cancellation, and final file size.

normal image viewer.

Fix order

  1. Prepare and validate the export payload first; disable Save until bytes are

available.

  1. Prefer the simplest stable save channel for the host. If

showSaveFilePicker().createWritable() fails, is sandboxed, or creates empty

files, route to <a download> or Electron's download manager instead.

  1. Avoid opening a native picker before the payload is ready. This prevents the

host from creating an empty destination file on later write failure.

  1. For PNG fallback, prefer a verified non-empty data URL when blob URLs,

revocation timing, CSP, or iframe sandboxing are suspicious.

  1. In Electron, add explicit Save As filters for exported image extensions

(.png, .jpg, .jpeg, .webp) so users can choose a real image target.

  1. Keep the UI restrained: format selection, filename/path hint, clear pending

and error states, and one primary save action.

Validation

file extension/MIME mapping, and UI disabled/error states.

pnpm --filter @open-design/desktop typecheck.

generated artifacts, and accidental secrets, then use the repository's PR

quality-gate workflow if the fix is being prepared for review.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.