{"record":{"id":"89ff12bc3e9e8b0f","repo":"remotion-dev/remotion","slug":"lut-effect-requires-a-parameters-object-but-got-json","errorCode":null,"errorMessage":"LUT effect requires a parameters object, but got ${JSON.stringify(params)}","messagePattern":"LUT effect requires a parameters object, but got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/index.ts","lineNumber":78,"sourceCode":"\tconst created = {\n\t\tparsed: parseCubeLut(content),\n\t\teffectKey: `lut-${content.length}-${firstHash >>> 0}-${secondHash >>> 0}`,\n\t};\n\tparsedLuts.set(content, created);\n\n\tif (parsedLuts.size > MAX_CACHED_LUTS) {\n\t\tconst oldestContent = parsedLuts.keys().next().value;\n\t\tif (oldestContent !== undefined) {\n\t\t\tparsedLuts.delete(oldestContent);\n\t\t}\n\t}\n\n\treturn created;\n};\n\nconst validateLutParams = (params: LutParams): void => {\n\tif (params === null || typeof params !== 'object') {\n\t\tthrow new TypeError(\n\t\t\t`LUT effect requires a parameters object, but got ${JSON.stringify(params)}`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof params.content !== 'string' ||\n\t\tparams.content.trim().length === 0\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`\"content\" must be a non-empty string, but got ${JSON.stringify(params.content)}`,\n\t\t);\n\t}\n\n\tgetCachedLut(params.content);\n};\n\nexport const lut = createEffect<LutParams, LutState>({\n\ttype: 'remotion/lut',","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/index.ts#L60-L96","documentation":"The lut() effect factory validates its parameters object before the effect is registered. This TypeError is thrown when you pass anything other than a plain object (null, undefined, a string, a number, etc.) as the parameters. The LUT effect needs a params object with a `content` field, so a non-object means the caller has called the API incorrectly.","triggerScenarios":"Calling `lut(null)`, `lut(undefined)`, `lut('some .cube string')`, `lut(buffer)` or any non-object value instead of `lut({content})`. Also happens if you destructure/spread incorrectly or pass a legacy positional argument shape that this effect does not accept.","commonSituations":"Copy-pasting older Remotion effect examples that used a different call signature; forgetting to wrap the LUT file contents in an object; passing the result of a failed async file read (undefined) straight into lut().","solutions":["Wrap the LUT contents in an object: lut({content: cubeFileContents}).","Log the value you pass and check it is a non-null object before calling lut().","Check the Remotion docs at https://www.remotion.dev/docs/effects/lut for the current LutParams shape."],"exampleFix":"// before\nconst effect = lut(cubeContents);\n// after\nconst effect = lut({content: cubeContents});","handlingStrategy":"validation","validationCode":"function isLutParams(v: unknown): v is {content: string} {\n  return v !== null && typeof v === 'object' && !Array.isArray(v);\n}\nif (!isLutParams(candidate)) throw new TypeError('lut() requires {content: string}');","typeGuard":"const isLutParams = (v: unknown): v is LutParams =>\n  v !== null && typeof v === 'object';","tryCatchPattern":"try {\n  const effect = lut(input as LutParams);\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('requires a parameters object')) {\n    console.error('Fix the lut() call: pass lut({content})');\n  } else throw e;\n}","preventionTips":["Always call lut() with an object literal: lut({content})","Let TypeScript infer the LutParams type instead of casting from unknown/any","Avoid passing values derived from possibly-failed async reads without checking for undefined"],"tags":["validation","typescript","api-usage"],"backgroundTag":"invalid-argument-value","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"}