{"record":{"id":"a5a682606147b607","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-unsupported-directive","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: unsupported directive \"${keyword}\"","messagePattern":"Invalid LUT content on line (.+?): unsupported directive \"(.+?)\"","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":159,"sourceCode":"\t\t\t}\n\n\t\t\tif (hasDomainMax) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: DOMAIN_MAX may only be declared once`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdomainMax = parseTriplet({\n\t\t\t\tvalues,\n\t\t\t\tlineNumber,\n\t\t\t\tlabel: 'DOMAIN_MAX',\n\t\t\t});\n\t\t\thasDomainMax = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (/^[A-Z_]/i.test(keyword)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Invalid LUT content on line ${lineNumber}: unsupported directive \"${keyword}\"`,\n\t\t\t);\n\t\t}\n\n\t\tif (size === null) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be declared before the color data`,\n\t\t\t);\n\t\t}\n\n\t\tparseTriplet({\n\t\t\tvalues: [keyword, ...values],\n\t\t\tlineNumber,\n\t\t\tlabel: 'color row',\n\t\t});\n\t\tdataStarted = true;\n\t\tdataRows++;\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L141-L177","documentation":"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.","triggerScenarios":"A .cube file contains directives like 'LUT_3D_INPUT_RANGE', 'DESCRIPTION', 'CREATED', 'VERSION', or a typo such as 'LUT_3D_SIZEE' passed to parseCubeLut().","commonSituations":"Vendor-specific extensions written by other LUT tools, corrupted keywords, or files from formats similar to but not exactly .cube.","solutions":["Remove the unsupported directive line from the .cube file","Fix the keyword spelling if it was a typo of a supported directive (e.g. LUT_3D_SIZE)","Convert the LUT with a tool like Nearest-neighbor resampling or lut utilities that emit standard-only .cube files"],"exampleFix":"// before\nTITLE \"Look\"\nLUT_3D_SIZE 2\nDESCRIPTION \"my lut\"\n// after\nTITLE \"Look\"\nLUT_3D_SIZE 2","handlingStrategy":"validation","validationCode":"const allowed = new Set(['TITLE', 'LUT_3D_SIZE', 'DOMAIN_MIN', 'DOMAIN_MAX']);\nfor (const line of content.split(/\\r?\\n/)) {\n  const t = line.split('#')[0].trim();\n  if (!t) continue;\n  const kw = t.split(/\\s+/)[0];\n  if (kw !== 'LUT_1D_SIZE' && !/^\\d/.test(kw) && !allowed.has(kw)) {\n    throw new Error(`Unsupported directive: ${kw}`);\n  }\n}","typeGuard":"null","tryCatchPattern":"try {\n  const lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('unsupported directive')) {\n    // strip unknown directive lines and retry, or reject the file\n  } else throw e;\n}","preventionTips":["Strip vendor-specific extensions before parsing","Use LUT conversion tools that emit standard .cube output","Double-check directive spelling"],"tags":["validation","lut","unsupported-directive"],"backgroundTag":"unsupported-operation","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}