heygen-com/hyperframes · error · CubeLutParseError
${keyword} expects a size
Error message
${keyword} expects a size What it means
parseSize rejects an empty or missing size argument on LUT_1D_SIZE / LUT_3D_SIZE. The throw at line 65 fires before numeric parsing, when rest[0] is undefined or the empty string.
Source
Thrown at packages/core/src/colorLuts.ts:65
if (!Number.isFinite(parsed)) {
throw new CubeLutParseError(`Invalid number "${value}"`, lineNumber);
}
return parsed;
}
function parseVec3(parts: string[], keyword: string, lineNumber: number): CubeLutVec3 {
if (parts.length !== 3) {
throw new CubeLutParseError(`${keyword} expects three numbers`, lineNumber);
}
return [
parseFiniteNumber(parts[0]!, lineNumber),
parseFiniteNumber(parts[1]!, lineNumber),
parseFiniteNumber(parts[2]!, lineNumber),
];
}
function parseSize(value: string | undefined, keyword: string, lineNumber: number): number {
if (!value) throw new CubeLutParseError(`${keyword} expects a size`, lineNumber);
const parsed = Number(value);
if (!Number.isInteger(parsed) || parsed < 2) {
throw new CubeLutParseError(`${keyword} must be an integer greater than 1`, lineNumber);
}
return parsed;
}
function validateDomain(domainMin: CubeLutVec3, domainMax: CubeLutVec3): void {
if (
domainMax[0] <= domainMin[0] ||
domainMax[1] <= domainMin[1] ||
domainMax[2] <= domainMin[2]
) {
throw new CubeLutParseError("DOMAIN_MAX values must be greater than DOMAIN_MIN values");
}
}
function parseTitle(line: string): string | null {View on GitHub (pinned to c2996c8626)
Solutions
- Add the integer size after the keyword, e.g. 'LUT_3D_SIZE 32'.
- Re-export the LUT — size is mandatory metadata that the source tool always emits.
- If generating LUTs programmatically, assert the size field is set before serialization.
Example fix
// before LUT_3D_SIZE // after LUT_3D_SIZE 32
Defensive patterns
Strategy: try-catch
Validate before calling
function assertSizePresent(line: string): void {
const parts = line.trim().split(/\s+/);
const keyword = (parts[0] ?? '').toUpperCase();
if ((keyword === 'LUT_1D_SIZE' || keyword === 'LUT_3D_SIZE') && !parts[1]) {
throw new Error(`${keyword} requires a size argument`);
}
} Try / catch
try {
parseCubeLut(fileText);
} catch (err) {
if (err instanceof CubeLutParseError && /expects a size/.test(err.message)) {
// prompt user for the missing size, or re-export
} else throw err;
} Prevention
- Always write the integer size on the LUT_*_SIZE line.
- Assert headers programmatically when generating LUTs.
- Re-export from the source tool, which always emits the size.
When it happens
Trigger: A header line 'LUT_3D_SIZE' with no following number, or a line whose only token is the keyword (rest is empty).
Common situations: Truncated header from a partial file write; a hand-authored template missing the size value; a stray newline splitting keyword from its argument.
Related errors
- ${keyword} must be an integer greater than 1
- Invalid number "${value}"
- ${keyword} expects three numbers
- DOMAIN_MAX values must be greater than DOMAIN_MIN values
- ${keyword} expects two numbers
AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12).
Data as JSON: /api/errors/215a6dc4d961d9a8.
Report an issue: GitHub.