heygen-com/hyperframes · error · Error

figma render download failed: HTTP ${res.status}

Error message

figma render download failed: HTTP ${res.status}

What it means

Thrown by downloadRender() when the fetch of figma's short-lived CDN render url returns a non-ok status. Figma's /v1/images hands back signed CDN urls that expire within minutes; any delay or a transient CDN fault surfaces here as the raw HTTP code.

Source

Thrown at packages/cli/src/commands/figma/download.ts:6

import { exceedsFreezeCap, MAX_FREEZE_BYTES } from "@hyperframes/core/figma";

/** Fetch a short-lived figma CDN render url into bytes. */
export async function downloadRender(url: string): Promise<Uint8Array> {
  const res = await fetch(url);
  if (!res.ok) throw new Error(`figma render download failed: HTTP ${res.status}`);
  // Reject oversized responses before buffering the body — the freeze cap
  // alone only fires after the full allocation.
  const declared = Number(res.headers.get("content-length") ?? 0);
  if (exceedsFreezeCap(declared))
    throw new Error(
      `figma render download failed: content-length ${declared} exceeds ${MAX_FREEZE_BYTES} cap`,
    );
  return new Uint8Array(await res.arrayBuffer());
}

View on GitHub (pinned to c2996c8626)

Solutions

  1. Re-run the whole import — it regenerates a fresh signed url
  2. Retry the fetch a few times with short backoff for transient 5xx
  3. Check system clock skew and network/proxy configuration
Defensive patterns

Strategy: retry

Try / catch

async function downloadWithRetry(url: string, attempts = 3): Promise<Uint8Array> {
  for (let i = 0; i < attempts; i += 1) {
    try {
      return await downloadRender(url);
    } catch (err) {
      const status = (err as Error).message.match(/HTTP (\d+)/)?.[1];
      const code = status ? Number(status) : 0;
      // Only retry transient codes; re-run the whole import if the url expired.
      if (i === attempts - 1 || (code !== 0 && code < 500 && code !== 403)) throw err;
      await new Promise(r => setTimeout(r, 500 * 2 ** i));
    }
  }
  throw new Error('download failed after retries');
}

Prevention

When it happens

Trigger: HTTP 403/404 from an expired or already-consumed signed url (clock skew, slow disk write, or a long pause between renderNodes and downloadRender); 5xx from a CDN outage; a network redirect that resolves to an error page.

Common situations: The render url was obtained but the download was delayed (heavy disk I/O, slow machine); figma CDN transient error; proxy/corporate network interfering with the signed url.

Related errors


AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12). Data as JSON: /api/errors/da47ab45c66b68c5. Report an issue: GitHub.