remotion-dev/remotion · error

Expected LUT_1D_SIZE or LUT_3D_SIZE.

Error message

Expected LUT_1D_SIZE or LUT_3D_SIZE.

What it means

parseCubeLut requires every .cube file to declare either LUT_1D_SIZE or LUT_3D_SIZE; without it the table type and allocation are unknown. After the whole file is scanned, if no size header was found (type or data still null), this error is thrown. It is the end-of-parse counterpart of the 'before color data' error and fires for files that contain no size header at all.

Solutions

  1. Add 'LUT_3D_SIZE n' (3D) or 'LUT_1D_SIZE n' (1D) as the first line of the file.
  2. Verify the file is actually .cube format — .3dl, .csp, .look use different headers and need a converter.
  3. Check that file upload/processing did not strip the header lines.
  4. Guard in code: confirm /LUT_(1D|3D)_SIZE/ matches the text before calling parseCubeLut.

Example fix

// before
TITLE "look"
# no size header, data only...
// after
TITLE "look"
LUT_3D_SIZE 33
# data...
Defensive patterns

Strategy: validation

Validate before calling

if (!/LUT_(1D|3D)_SIZE/.test(text)) {
  throw new Error('Not a .cube file: missing size header');
}

Type guard

const looksLikeCube = (text: string): boolean =>
  /LUT_(1D|3D)_SIZE/.test(text);

Try / catch

let lut: CubeLut | null = null;
try {
  lut = parseCubeLut(text);
} catch {
  lut = null; // fall back or show a format error to the user
}

Prevention

When it happens

Trigger: parseCubeLut(text) on a file consisting only of comments, blank lines, TITLE/DOMAIN headers, or pure color data with no LUT_1D_SIZE/LUT_3D_SIZE line anywhere; also an empty string.

Common situations: Metadata-only sidecar files; uploads where the first lines were stripped; users pointing the parser at a .3dl or .csp file renamed to .cube (different header vocabulary entirely).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18). Data as JSON: /api/errors/4a80cd32f1e817fd. Report an issue: GitHub.

Appendix: source

Thrown at packages/studio/src/helpers/cube-lut.ts:126

		const color = [Number(keyword), ...numbers];
		if (
			color.length !== 3 ||
			!color.every((value) => Number.isFinite(Math.fround(value)))
		) {
			throw new Error(`Invalid LUT color on line ${index + 1}.`);
		}

		if (offset + 3 > data.length) {
			throw new Error(`Expected ${data.length / 3} LUT colors, got more.`);
		}

		data.set(color, offset);
		offset += 3;
	}

	if (type === null || data === null) {
		throw new Error('Expected LUT_1D_SIZE or LUT_3D_SIZE.');
	}

	if (offset !== data.length) {
		throw new Error(
			`Expected ${data.length / 3} LUT colors, got ${offset / 3}.`,
		);
	}

	if (domainMin.some((min, channel) => min >= domainMax[channel])) {
		throw new Error(
			'DOMAIN_MAX must be greater than DOMAIN_MIN in every channel.',
		);
	}

	if (
		domainMin.some((min, channel) => !Number.isFinite(domainMax[channel] - min))
	) {
		throw new Error('LUT input ranges must be finite.');

View on GitHub (pinned to 46a3a6bf13)