heygen-com/hyperframes · error · Error

figma asset import produced no result for "${refInput}"

Error message

figma asset import produced no result for "${refInput}"

What it means

Thrown by runAssetImport(), the single-ref convenience wrapper. It delegates to runAssetImportMany([refInput]) and asserts the result array is non-empty. Under the current contract runAssetImportMany always returns one slot for one input (or throws RENDER_FAILED first), so reaching this line means an internal length invariant was broken. Treat hitting it as a bug, not an expected failure mode.

Source

Thrown at packages/cli/src/commands/figma/asset.ts:165

      source: "figma",
      fileKey,
      nodeId,
      version,
      format: opts.format,
      scale: opts.scale,
    },
  };
  appendRecord(deps.projectDir, record);
  return { record, snippet: buildAssetSnippet(record), reused: false };
}

export async function runAssetImport(
  refInput: string,
  opts: AssetImportOptions,
  deps: AssetImportDeps,
): Promise<AssetImportResult> {
  const [result] = await runAssetImportMany([refInput], opts, deps);
  if (!result) throw new Error(`figma asset import produced no result for "${refInput}"`);
  return result;
}

/**
 * Import many nodes of ONE figma file. Cache-checks each, renders the misses
 * in a SINGLE /v1/images batch call (figma's documented rate-limit
 * workaround — N nodes, one REST request), freezes each, and regenerates
 * index.md once. Results come back in input order.
 */
export async function runAssetImportMany(
  refInputs: string[],
  opts: AssetImportOptions,
  deps: AssetImportDeps,
): Promise<AssetImportResult[]> {
  if (refInputs.length === 0) return [];
  const refs = refInputs.map(requireNodeRef);
  const fileKey = refs[0]!.fileKey;
  const mixed = refs.find((r) => r.fileKey !== fileKey);

View on GitHub (pinned to c2996c8626)

Solutions

  1. Do not try to handle this in application code — report it as an internal bug
  2. Re-run the import; if reproducible, capture the exact ref string and open an issue
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await runAssetImport(ref, opts, deps);
} catch (err) {
  // Defensive guard — if hit, it is an internal invariant break, not user input.
  // Capture the ref and report rather than masking.
  if ((err as Error).message.includes('produced no result')) {
    console.error('internal: runAssetImport returned no result for', ref);
  }
  throw err;
}

Prevention

When it happens

Trigger: Effectively unreachable in normal flow: would require runAssetImportMany to return an empty array for a non-empty input list, which the early `if (refInputs.length === 0) return []` guard and the subsequent slots.map prevent.

Common situations: Only if a future refactor breaks the 1:1 input/output length contract of runAssetImportMany, or a caller passes a refInput that parseFigmaRef reduces to nothing in an unexpected way.

Related errors


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