{"record":{"id":"08033cea1fd7145b","repo":"remotion-dev/remotion","slug":"invalid-lut-content-on-line-linenumber-label-must-contain-08033c","errorCode":null,"errorMessage":"Invalid LUT content on line ${lineNumber}: ${label} must contain only finite numbers","messagePattern":"Invalid LUT content on line (.+?): (.+?) must contain only finite numbers","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/parse-cube-lut.ts","lineNumber":40,"sourceCode":"\nconst parseTriplet = ({\n\tvalues,\n\tlineNumber,\n\tlabel,\n}: {\n\treadonly values: readonly string[];\n\treadonly lineNumber: number;\n\treadonly label: string;\n}): readonly [number, number, number] => {\n\tif (values.length !== 3) {\n\t\tthrow new TypeError(\n\t\t\t`Invalid LUT content on line ${lineNumber}: ${label} must contain exactly 3 numbers`,\n\t\t);\n\t}\n\n\tconst parsed = values.map((value) => Number(value));\n\tif (parsed.some((value) => !Number.isFinite(value))) {\n\t\tthrow new TypeError(\n\t\t\t`Invalid LUT content on line ${lineNumber}: ${label} must contain only finite numbers`,\n\t\t);\n\t}\n\n\treturn [parsed[0], parsed[1], parsed[2]];\n};\n\nconst HEADER_DIRECTIVES = new Set([\n\t'TITLE',\n\t'LUT_3D_SIZE',\n\t'DOMAIN_MIN',\n\t'DOMAIN_MAX',\n]);\n\nexport const parseCubeLut = (content: string): ParsedCubeLut => {\n\tconst lines = content.replace(/^\\uFEFF/, '').split(/\\r?\\n/);\n\tlet size: number | null = null;\n\tlet domainMin: readonly [number, number, number] = [0, 0, 0];","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/parse-cube-lut.ts#L22-L58","documentation":"parseTriplet() maps each of the 3 values with Number() and throws a TypeError if any result is not finite (NaN, Infinity, -Infinity). A .cube data row must consist of parseable numeric literals, so values like 'abc', empty strings, or overflowing numbers make the whole LUT invalid.","triggerScenarios":"A .cube file containing non-numeric tokens in data rows ('N/A', '-', '..'), empty fields from double spaces around a missing value, locale-formatted numbers ('0,5' parsed as invalid), or scientific notation beyond Number range.","commonSituations":"Corrupted downloads (HTML error pages saved as .cube); files exported with localized decimal commas; manual edits inserting placeholders; truncated files producing empty tokens that Number('') would coerce to 0 but Number(' ') to 0 while 'x' yields NaN.","solutions":["Inspect the reported line number and replace the non-numeric token with a valid decimal value","Re-export the .cube from the grading software rather than hand-editing","Convert localized decimal commas to periods before parsing","Pre-validate the file: every data line must match /^-?\\d+(\\.\\d+)?(e[+-]?\\d+)?(\\s+-?\\d+(\\.\\d+)?(e[+-]?\\d+)?){2}$/i","Verify the downloaded file is text, not an HTML error page"],"exampleFix":"// before: bad token in .cube data row\n0.1 N/A 0.3\n// after: all finite numbers\n0.1 0.2 0.3","handlingStrategy":"validation","validationCode":"const numRe = /^-?\\d*\\.?\\d+([eE][+-]?\\d+)?$/;\nconst dataLines = cubeText.split('\\n').filter((l) => l && !l.startsWith('#') && /^\\s*[\\d.\\-eE+]/.test(l));\nconst bad = dataLines.findIndex((l) => !l.trim().split(/\\s+/).every((v) => numRe.test(v) && Number.isFinite(Number(v))));\nif (bad !== -1) {\n  throw new Error(`.cube data line ${bad + 1} contains a non-finite value`);\n}","typeGuard":"const isFiniteTriplet = (values: readonly string[]): boolean =>\n  values.length === 3 && values.map(Number).every((n) => Number.isFinite(n));","tryCatchPattern":"try {\n  const lut = parseCubeLut(cubeText);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must contain only finite numbers')) {\n    // e.message contains the line number; fix or remove that row and re-parse\n  }\n}","preventionTips":["Verify downloaded .cube files are plain text (not HTML error pages)","Normalize locale decimal commas to periods before parsing","Pre-validate every data token with a numeric regex","Avoid manual edits; re-export LUTs from source tools"],"tags":["lut","cube-format","parsing","nan"],"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"}