{"record":{"id":"7b5e15a14b50d329","repo":"remotion-dev/remotion","slug":"cannot-update-effect-prop-computed","errorCode":null,"errorMessage":"Cannot update effect prop: computed","messagePattern":"Cannot update effect prop: computed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio-codemods/src/effect-operations.ts","lineNumber":1059,"sourceCode":"\t\tupdate.defaultValue !== null &&\n\t\tJSON.stringify(update.value) === JSON.stringify(update.defaultValue);\n\tlet object: ObjectExpression;\n\tif (call.arguments.length === 0) {\n\t\tif (isDefault) {\n\t\t\treturn {\n\t\t\t\tserialized: input,\n\t\t\t\toldValueString: '',\n\t\t\t\tnewValueString: JSON.stringify(update.defaultValue),\n\t\t\t\tlogLine: call.loc?.start.line ?? jsx.loc?.start.line ?? 1,\n\t\t\t\teffectCallee,\n\t\t\t\tremovedProps: [],\n\t\t\t};\n\t\t}\n\n\t\tobject = b.objectExpression([]) as ObjectExpression;\n\t\tcall.arguments.push(object);\n\t} else if (call.arguments[0].type !== 'ObjectExpression') {\n\t\tthrow new Error('Cannot update effect prop: computed');\n\t} else {\n\t\tobject = call.arguments[0] as ObjectExpression;\n\t}\n\n\tconst existing = findObjectProperty(object, update.key);\n\tlet oldValueString = '';\n\tif (existing) {\n\t\toldValueString = recast.print(existing.value).code;\n\t} else if (update.defaultValue !== null) {\n\t\toldValueString = JSON.stringify(update.defaultValue);\n\t}\n\n\tlet newValueString = '';\n\tif (isDefault) {\n\t\tnewValueString = JSON.stringify(update.defaultValue);\n\t\tif (existing) {\n\t\t\tobject.properties.splice(object.properties.indexOf(existing), 1);\n\t\t}","sourceCodeStart":1041,"sourceCodeEnd":1077,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-codemods/src/effect-operations.ts#L1041-L1077","documentation":"updateEffectPropsAst() expects the effect call's first argument to be an object literal of props (e.g. Spring({damping: 10})). If the call has arguments but the first one is not an ObjectExpression — e.g. Spring(computedProps) or Spring(getConfig()) — the library cannot safely merge a prop update into an arbitrary expression and throws this error.","triggerScenarios":"Updating a prop on an effect written as effects={[Spring(config)]} or effects={[interpolate(vars)]} where the first argument is an identifier, function call, or other non-object-literal expression.","commonSituations":"Hand-refactored code that hoisted the props object into a variable for reuse; generated code that passed a computed config; effects whose props come from state or another component.","solutions":["Inline an object literal into the effect call: Spring({damping: config.damping}) instead of Spring(config).","Manually edit the extracted props variable when the value is intentionally computed.","Have your tooling detect non-literal first arguments and disable prop editing for those effects."],"exampleFix":"// before\nconst config = {damping: 10};\n<Sequence effects={[Spring(config)]} />\n// after\n<Sequence effects={[Spring({damping: 10})]} />","handlingStrategy":"type-guard","validationCode":"const firstArg = getFirstArgument(input, sequenceNodePath, effectIndex);\nif (firstArg && firstArg.type !== 'ObjectExpression') {\n  // disable prop editing for this effect\n}","typeGuard":"const isObjectLiteralArg = (\n  arg: ExpressionKind,\n): arg is ObjectExpression => arg.type === 'ObjectExpression';","tryCatchPattern":"try {\n  await updateEffectProps({input, effectIndex, sequenceNodePath, update, schema});\n} catch (e) {\n  if (e instanceof Error && e.message === 'Cannot update effect prop: computed') {\n    // ask the user to inline the props object before editing\n  } else throw e;\n}","preventionTips":["Author effect calls with inline object literals: Spring({damping: 10}).","Detect non-literal first arguments in tooling and mark those effects read-only."],"tags":["ast","unsupported-operation","type-mismatch"],"backgroundTag":"type-mismatch","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"}