{"record":{"id":"6a81db9e855c7a23","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-lut-3d-size-must","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE must contain exactly one integer","messagePattern":"Invalid LUT content on line (.+?): LUT_3D_SIZE must contain exactly one integer","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":107,"sourceCode":"\t\t\t\tif (hasTitle) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: TITLE may only be declared once`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\thasTitle = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (keyword === 'LUT_3D_SIZE') {\n\t\t\t\tif (size !== null) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t`Invalid LUT content on line ${lineNumber}: LUT_3D_SIZE may only be declared once`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (values.length !== 1) {\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 contain exactly one integer`,\n\t\t\t\t\t);\n\t\t\t\t}\n\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}","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L89-L125","documentation":"The LUT_3D_SIZE directive takes exactly one integer argument. parseCubeLut() throws this TypeError when the LUT_3D_SIZE line has zero or more than one value, e.g. 'LUT_3D_SIZE' alone or 'LUT_3D_SIZE 32 32'.","triggerScenarios":"A .cube file contains 'LUT_3D_SIZE' with no argument, or with multiple whitespace-separated tokens, and is passed to parseCubeLut().","commonSituations":"Truncated file where the size value was lost, copy-paste dropping a digit, or confusion with formats that specify per-axis sizes.","solutions":["Write LUT_3D_SIZE as a single integer matching the cube dimension, e.g. 'LUT_3D_SIZE 32'","Ensure the number of color rows equals that integer cubed","Re-export the LUT if the header was corrupted by another tool"],"exampleFix":"// before\nLUT_3D_SIZE 32 32\n// after\nLUT_3D_SIZE 32","handlingStrategy":"validation","validationCode":"const m = content.match(/^LUT_3D_SIZE\\s+(\\S+)/m);\nif (!m || !/\\D/.test(m[1]) === false || m[1].includes(' ')) throw new Error('LUT_3D_SIZE must be a single integer');","typeGuard":"null","tryCatchPattern":"try {\n  const lut = parseCubeLut(content);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must contain exactly one integer')) {\n    // fix or regenerate the LUT_3D_SIZE line\n  } else throw e;\n}","preventionTips":["Always emit 'LUT_3D_SIZE <N>' with exactly one integer token","Validate LUT headers with a regex before parsing"],"tags":["validation","lut","argument-count"],"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"}