{"record":{"id":"c8dffbc6823828b6","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-domain-max-may-only","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: DOMAIN_MAX may only be declared once","messagePattern":"Invalid LUT content on line (.+?): DOMAIN_MAX may only be declared once","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":144,"sourceCode":"\n\t\t\tif (keyword === 'DOMAIN_MIN') {\n\t\t\t\tif (hasDomainMin) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: DOMAIN_MIN may only be declared once`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tdomainMin = parseTriplet({\n\t\t\t\t\tvalues,\n\t\t\t\t\tlineNumber,\n\t\t\t\t\tlabel: 'DOMAIN_MIN',\n\t\t\t\t});\n\t\t\t\thasDomainMin = true;\n\t\t\t\tcontinue;\n\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}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L126-L162","documentation":"DOMAIN_MAX sets the upper input bound of the LUT per channel and may be declared only once. parseCubeLut() throws this TypeError when a second DOMAIN_MAX line appears (this check also covers any second occurrence of the final header directive).","triggerScenarios":"parseCubeLut() receives content containing two DOMAIN_MAX lines, e.g. 'DOMAIN_MAX 1 1 1' followed by 'DOMAIN_MAX 2 2 2'.","commonSituations":"Merged LUT files, manual edits that append a corrected domain line rather than replacing the original.","solutions":["Delete the extra DOMAIN_MAX line, keeping only one","Update the existing DOMAIN_MAX values instead of adding a new line","Re-export the LUT with a single domain declaration"],"exampleFix":"// before\nDOMAIN_MAX 1 1 1\nDOMAIN_MAX 2 2 2\n// after\nDOMAIN_MAX 2 2 2","handlingStrategy":"validation","validationCode":"const maxes = content.split(/\\r?\\n/).filter((l) => l.trim().startsWith('DOMAIN_MAX'));\nif (maxes.length > 1) throw new Error('Duplicate DOMAIN_MAX');","typeGuard":"null","tryCatchPattern":"try {\n  const lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('DOMAIN_MAX may only be declared once')) {\n    // dedupe DOMAIN_MAX lines and retry\n  } else throw e;\n}","preventionTips":["Keep one DOMAIN_MAX declaration per file","Edit domain values in place rather than appending new lines"],"tags":["validation","lut","duplicate-directive"],"backgroundTag":"invalid-argument-format","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"}