{"record":{"id":"6d71f63bf90288af","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-domain-min-may-only","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: DOMAIN_MIN may only be declared once","messagePattern":"Invalid LUT content on line (.+?): DOMAIN_MIN may only be declared once","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":129,"sourceCode":"\n\t\t\t\tconst parsedSize = Number(values[0]);\n\t\t\t\tif (\n\t\t\t\t\t!Number.isInteger(parsedSize) ||\n\t\t\t\t\tparsedSize < 2 ||\n\t\t\t\t\tparsedSize > 256\n\t\t\t\t) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must be an integer from 2 to 256`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tsize = parsedSize;\n\t\t\t\tcontinue;\n\t\t\t}\n\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}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L111-L147","documentation":"This TypeError is a structural validation failure in the .cube LUT parser: within parseCubeLut, the DOMAIN_MIN directive is a global header that defines the input domain's lower bound, so it is only meaningful once per file. The parser tracks a hasDomainMin flag, and fires this error the second time a DOMAIN_MIN line is encountered in the same .cube file. It indicates the LUT file itself is malformed (duplicate header), not a problem with the caller's code; the fix is to correct the LUT file so it declares DOMAIN_MIN at most once.","triggerScenarios":"parseCubeLut() receives content with two DOMAIN_MIN lines, e.g. 'DOMAIN_MIN 0 0 0' followed by 'DOMAIN_MIN 0.1 0.1 0.1'.","commonSituations":"Hand-edited files where the domain was changed by adding a line instead of editing, or concatenated LUT files.","solutions":["Remove the duplicate DOMAIN_MIN line, keeping a single declaration","Edit the existing DOMAIN_MIN values in place","Re-export the LUT from the original tool"],"exampleFix":"// before\nDOMAIN_MIN 0 0 0\nDOMAIN_MIN 0.1 0.1 0.1\n// after\nDOMAIN_MIN 0.1 0.1 0.1","handlingStrategy":"validation","validationCode":"const mins = content.split(/\\r?\\n/).filter((l) => l.trim().startsWith('DOMAIN_MIN'));\nif (mins.length > 1) throw new Error('Duplicate DOMAIN_MIN');","typeGuard":"null","tryCatchPattern":"try {\n  const lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('DOMAIN_MIN may only be declared once')) {\n    // dedupe DOMAIN_MIN lines and retry\n  } else throw e;\n}","preventionTips":["Keep one DOMAIN_MIN declaration per file","Deduplicate headers when merging LUT files"],"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"}