remotion-dev/remotion · error · TypeError

Invalid LUT content on line

Error message

Invalid LUT content on line ${lineNumber}: unsupported directive "${keyword}"

What it means

Only TITLE, LUT_3D_SIZE, DOMAIN_MIN and DOMAIN_MAX are recognized header directives (and LUT_1D_SIZE is explicitly rejected). Any line starting with a letter/underscore that is not one of these is treated as an unknown directive and parseCubeLut() throws this TypeError, because silently ignoring directives could change color interpretation.

Solutions

  1. Remove the unsupported directive line from the .cube file
  2. Fix the keyword spelling if it was a typo of a supported directive (e.g. LUT_3D_SIZE)
  3. Convert the LUT with a tool like Nearest-neighbor resampling or lut utilities that emit standard-only .cube files

Example fix

// before
TITLE "Look"
LUT_3D_SIZE 2
DESCRIPTION "my lut"
// after
TITLE "Look"
LUT_3D_SIZE 2
Defensive patterns

Strategy: validation

Validate before calling

const allowed = new Set(['TITLE', 'LUT_3D_SIZE', 'DOMAIN_MIN', 'DOMAIN_MAX']);
for (const line of content.split(/\r?\n/)) {
  const t = line.split('#')[0].trim();
  if (!t) continue;
  const kw = t.split(/\s+/)[0];
  if (kw !== 'LUT_1D_SIZE' && !/^\d/.test(kw) && !allowed.has(kw)) {
    throw new Error(`Unsupported directive: ${kw}`);
  }
}

Type guard

null

Try / catch

try {
  const lut = parseCubeLut(content);
} catch (e) {
  if (e instanceof TypeError && e.message.includes('unsupported directive')) {
    // strip unknown directive lines and retry, or reject the file
  } else throw e;
}

Prevention

When it happens

Trigger: A .cube file contains directives like 'LUT_3D_INPUT_RANGE', 'DESCRIPTION', 'CREATED', 'VERSION', or a typo such as 'LUT_3D_SIZEE' passed to parseCubeLut().

Common situations: Vendor-specific extensions written by other LUT tools, corrupted keywords, or files from formats similar to but not exactly .cube.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at packages/effects/src/lut/parse-cube-lut.ts:159

			}

			if (hasDomainMax) {
				throw new TypeError(
					`Invalid LUT content on line ${lineNumber}: DOMAIN_MAX may only be declared once`,
				);
			}

			domainMax = parseTriplet({
				values,
				lineNumber,
				label: 'DOMAIN_MAX',
			});
			hasDomainMax = true;
			continue;
		}

		if (/^[A-Z_]/i.test(keyword)) {
			throw new TypeError(
				`Invalid LUT content on line ${lineNumber}: unsupported directive "${keyword}"`,
			);
		}

		if (size === null) {
			throw new TypeError(
				`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be declared before the color data`,
			);
		}

		parseTriplet({
			values: [keyword, ...values],
			lineNumber,
			label: 'color row',
		});
		dataStarted = true;
		dataRows++;

View on GitHub (pinned to 46a3a6bf13)