heygen-com/hyperframes · error · BatchRenderInputError

${source} contains zero rows.

Error message

${source} contains zero rows.

What it means

BatchRenderInputError with title 'Empty batch', thrown by parseBatchRows when the rows array exists but has length 0. Batch rendering zero rows would produce no output and is almost certainly a mistake, so the parser rejects it eagerly after the shape check passes.

Source

Thrown at packages/cli/src/commands/batchRender.ts:110

  try {
    return JSON.parse(raw);
  } catch (error: unknown) {
    throw new BatchRenderInputError("Invalid JSON in --batch", `${source}: ${errorMessage(error)}`);
  }
}

export function parseBatchRows(raw: string, source: string): Record<string, unknown>[] {
  const parsed = parseJson(raw, source);
  const rows = Array.isArray(parsed) ? parsed : isRecord(parsed) ? parsed.rows : undefined;

  if (!Array.isArray(rows)) {
    throw new BatchRenderInputError(
      "Invalid batch payload",
      '--batch must be a JSON array of objects, or an object with a "rows" array.',
    );
  }
  if (rows.length === 0) {
    throw new BatchRenderInputError("Empty batch", `${source} contains zero rows.`);
  }

  return rows.map((row, index) => {
    if (!isRecord(row)) {
      throw new BatchRenderInputError(
        "Invalid batch row",
        `Row ${index} must be a JSON object of variable values.`,
      );
    }
    return row;
  });
}

function placeholderValue(row: Record<string, unknown>, key: string, index: number): string {
  if (key === "index") return String(index);
  if (!Object.hasOwn(row, key)) {
    throw new BatchRenderInputError(
      "Invalid output template",

View on GitHub (pinned to c2996c8626)

Solutions

  1. Confirm the data source actually has rows; regenerate the batch file.
  2. If you intentionally want zero output, do not invoke render at all.
  3. Add an upstream assertion that rows.length > 0 before calling render.

Example fix

# before: empty array
hyperframes render --batch '[]'

# after: at least one row
hyperframes render --batch '[{"out":"a.mp4"}]'
Defensive patterns

Strategy: validation

Validate before calling

function assertNonEmptyRows(rows: unknown[]) {
  if (rows.length === 0) throw new Error('batch has zero rows; nothing to render');
}

Try / catch

try {
  parseBatchRows(raw, source);
} catch (err) {
  if (err instanceof BatchRenderInputError && err.title === 'Empty batch') {
    // regenerate the batch from the data source
  }
}

Prevention

When it happens

Trigger: Passing `--batch '[]'` or `{"rows":[]}`; a generated batch file whose templating produced zero rows; a filter upstream that removed every row.

Common situations: A script generates the batch from a spreadsheet/DB query that returned no rows; the user passed an empty array as a placeholder; conditional logic dropped all elements.

Related errors


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