remotion-dev/remotion · error
must contain three finite numbers.
Error message
${keyword} must contain three finite numbers. What it means
DOMAIN_MIN and DOMAIN_MAX headers in a .cube file must each contain exactly three finite numbers defining the LUT input domain. parseCubeLut throws when the line has a different count of values or contains non-finite numbers (NaN/Infinity).
Solutions
- Rewrite DOMAIN_MIN/DOMAIN_MAX lines to exactly three finite numbers, e.g. 'DOMAIN_MIN 0 0 0' and 'DOMAIN_MAX 1 1 1'.
- Remove the DOMAIN lines entirely if the default 0–1 domain is intended (they are optional).
- Re-export the LUT from a compliant tool.
- Check the reported line for missing or corrupted numeric values.
Example fix
// before DOMAIN_MIN 0 0 // after DOMAIN_MIN 0 0 0
Defensive patterns
Strategy: validation
Validate before calling
for (const line of text.split('\n')) {
const m = line.match(/^DOMAIN_(MIN|MAX)\s+(.*)$/);
if (m) {
const nums = m[2].trim().split(/\s+/).map(Number);
if (nums.length !== 3 || !nums.every(Number.isFinite)) throw new Error(`Bad ${m[1]} on: ${line}`);
}
} Type guard
null
Try / catch
try {
parseCubeLut(text);
} catch (err) {
if (err.message.includes('must contain three finite numbers')) {
// fix or drop the DOMAIN line (defaults apply)
}
} Prevention
- Always write DOMAIN_MIN/MAX with exactly three finite numbers
- Omit DOMAIN lines when the 0-1 default domain is fine
- Validate header numerics before loading LUT files
When it happens
Trigger: Loading a .cube file with lines like 'DOMAIN_MIN 0 0' (two values), 'DOMAIN_MAX 0 0 0 0' (four values), or values parsing to NaN/Infinity (e.g. 'DOMAIN_MIN 0 0 inf').
Common situations: Non-standard LUTs exported with 2- or 4-component domain lines; corrupted files where a value was dropped; typos like 'Infinity' text in the header.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Combined 1D and 3D LUTs are not supported.
- Duplicate on line .
- Expected LUT colors, got more.
- Expected LUT colors, got .
- Expected LUT_1D_SIZE or LUT_3D_SIZE.
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/ebdf303b816cc7da.
Report an issue: GitHub.
Appendix: source
Thrown at packages/studio/src/helpers/cube-lut.ts:73
type = keyword === 'LUT_1D_SIZE' ? '1d' : '3d';
size = numbers[0];
const maxSize = type === '1d' ? 65536 : 256;
if (
numbers.length !== 1 ||
!Number.isInteger(size) ||
size < 2 ||
size > maxSize
) {
throw new Error(`${keyword} must be an integer from 2 to ${maxSize}.`);
}
data = new Float32Array((type === '1d' ? size : size ** 3) * 3);
continue;
}
if (keyword === 'DOMAIN_MIN' || keyword === 'DOMAIN_MAX') {
if (numbers.length !== 3 || !numbers.every(Number.isFinite)) {
throw new Error(`${keyword} must contain three finite numbers.`);
}
if (keyword === 'DOMAIN_MIN') {
domainMin = [numbers[0], numbers[1], numbers[2]];
} else {
domainMax = [numbers[0], numbers[1], numbers[2]];
}
continue;
}
if (keyword === 'LUT_1D_INPUT_RANGE' || keyword === 'LUT_3D_INPUT_RANGE') {
if (
numbers.length !== 2 ||
!numbers.every(Number.isFinite) ||
numbers[0] >= numbers[1]
) {
throw new Error(`${keyword} must contain an increasing input range.`);View on GitHub (pinned to 46a3a6bf13)