remotion-dev/remotion · error · TypeError
Invalid LUT content on line
Error message
Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must contain exactly one integer What it means
The LUT_3D_SIZE directive takes exactly one integer argument. parseCubeLut() throws this TypeError when the LUT_3D_SIZE line has zero or more than one value, e.g. 'LUT_3D_SIZE' alone or 'LUT_3D_SIZE 32 32'.
Solutions
- Write LUT_3D_SIZE as a single integer matching the cube dimension, e.g. 'LUT_3D_SIZE 32'
- Ensure the number of color rows equals that integer cubed
- Re-export the LUT if the header was corrupted by another tool
Example fix
// before LUT_3D_SIZE 32 32 // after LUT_3D_SIZE 32
Defensive patterns
Strategy: validation
Validate before calling
const m = content.match(/^LUT_3D_SIZE\s+(\S+)/m);
if (!m || !/\D/.test(m[1]) === false || m[1].includes(' ')) throw new Error('LUT_3D_SIZE must be a single integer'); Type guard
null
Try / catch
try {
const lut = parseCubeLut(content);
} catch (e) {
if (e instanceof TypeError && e.message.includes('must contain exactly one integer')) {
// fix or regenerate the LUT_3D_SIZE line
} else throw e;
} Prevention
- Always emit 'LUT_3D_SIZE <N>' with exactly one integer token
- Validate LUT headers with a regex before parsing
When it happens
Trigger: A .cube file contains 'LUT_3D_SIZE' with no argument, or with multiple whitespace-separated tokens, and is passed to parseCubeLut().
Common situations: Truncated file where the size value was lost, copy-paste dropping a digit, or confusion with formats that specify per-axis sizes.
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.
- Conflicting LUT input range headers.
- DOMAIN_MAX must be greater than DOMAIN_MIN in every channel.
- Duplicate on line .
- Expected LUT colors, got more.
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/6a81db9e855c7a23.
Report an issue: GitHub.
Appendix: source
Thrown at packages/effects/src/lut/parse-cube-lut.ts:107
if (hasTitle) {
throw new TypeError(
`Invalid LUT content on line ${lineNumber}: TITLE may only be declared once`,
);
}
hasTitle = true;
continue;
}
if (keyword === 'LUT_3D_SIZE') {
if (size !== null) {
throw new TypeError(
`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE may only be declared once`,
);
}
if (values.length !== 1) {
throw new TypeError(
`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must contain exactly one integer`,
);
}
const parsedSize = Number(values[0]);
if (
!Number.isInteger(parsedSize) ||
parsedSize < 2 ||
parsedSize > 256
) {
throw new TypeError(
`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be an integer from 2 to 256`,
);
}
size = parsedSize;
continue;
}View on GitHub (pinned to 46a3a6bf13)