heygen-com/hyperframes · error · CubeLutParseError

${keyword} expects two numbers

Error message

${keyword} expects two numbers

What it means

LUT_3D_INPUT_RANGE is a shorthand that sets a uniform cubic domain from two scalars (min and max). The throw at line 127 requires exactly two tokens after the keyword, distinguishing it from the three-token DOMAIN_MIN/DOMAIN_MAX form.

Source

Thrown at packages/core/src/colorLuts.ts:127

    const parts = line.split(/\s+/);
    const keyword = (parts[0] ?? "").toUpperCase();
    const rest = parts.slice(1);

    if (keyword === "TITLE") {
      title = parseTitle(line);
      continue;
    }
    if (keyword === "DOMAIN_MIN") {
      domainMin = parseVec3(rest, keyword, lineNumber);
      continue;
    }
    if (keyword === "DOMAIN_MAX") {
      domainMax = parseVec3(rest, keyword, lineNumber);
      continue;
    }
    if (keyword === "LUT_3D_INPUT_RANGE") {
      if (rest.length !== 2) {
        throw new CubeLutParseError(`${keyword} expects two numbers`, lineNumber);
      }
      const min = parseFiniteNumber(rest[0]!, lineNumber);
      const max = parseFiniteNumber(rest[1]!, lineNumber);
      if (max <= min) {
        throw new CubeLutParseError("LUT_3D_INPUT_RANGE max must exceed min", lineNumber);
      }
      domainMin = [min, min, min];
      domainMax = [max, max, max];
      continue;
    }
    if (keyword === "LUT_1D_SIZE") {
      lut1dSize = parseSize(rest[0], keyword, lineNumber);
      continue;
    }
    if (keyword === "LUT_3D_SIZE") {
      lut3dSize = parseSize(rest[0], keyword, lineNumber);
      if (lut3dSize > maxSize) {
        throw new CubeLutParseError(`LUT_3D_SIZE ${lut3dSize} exceeds max ${maxSize}`, lineNumber);

View on GitHub (pinned to c2996c8626)

Solutions

  1. Provide exactly two numbers: min then max, e.g. 'LUT_3D_INPUT_RANGE 0 1'.
  2. If you need per-channel domains, use DOMAIN_MIN and DOMAIN_MAX instead of LUT_3D_INPUT_RANGE.
  3. Re-export from the source tool.

Example fix

// before
LUT_3D_INPUT_RANGE 0 0.5 1

// after
LUT_3D_INPUT_RANGE 0 1
Defensive patterns

Strategy: try-catch

Validate before calling

function assertInputRangeArity(line: string): void {
  const parts = line.trim().split(/\s+/);
  if ((parts[0] ?? '').toUpperCase() === 'LUT_3D_INPUT_RANGE' && parts.length !== 3) {
    throw new Error(`LUT_3D_INPUT_RANGE needs exactly 2 numbers, got ${parts.length - 1}`);
  }
}

Try / catch

try {
  parseCubeLut(fileText);
} catch (err) {
  if (err instanceof CubeLutParseError && /expects two numbers/.test(err.message)) {
    // report the line; offer to convert to DOMAIN_MIN/MAX
  } else throw err;
}

Prevention

When it happens

Trigger: A line 'LUT_3D_INPUT_RANGE 0 1' is valid; 'LUT_3D_INPUT_RANGE 0' (one), 'LUT_3D_INPUT_RANGE 0 0.5 1' (three), or 'LUT_3D_INPUT_RANGE' (none) trips the check.

Common situations: Author confused the 2-scalar range form with the 3-vector DOMAIN_MIN/MAX form; an extra column from a spreadsheet export; a templating bug emitting three values.

Related errors


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