remotion-dev/remotion · error

Cannot update effect prop: computed

Error message

Cannot update effect prop: computed

What it means

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.

Solutions

  1. Inline an object literal into the effect call: Spring({damping: config.damping}) instead of Spring(config).
  2. Manually edit the extracted props variable when the value is intentionally computed.
  3. Have your tooling detect non-literal first arguments and disable prop editing for those effects.

Example fix

// before
const config = {damping: 10};
<Sequence effects={[Spring(config)]} />
// after
<Sequence effects={[Spring({damping: 10})]} />
Defensive patterns

Strategy: type-guard

Validate before calling

const firstArg = getFirstArgument(input, sequenceNodePath, effectIndex);
if (firstArg && firstArg.type !== 'ObjectExpression') {
  // disable prop editing for this effect
}

Type guard

const isObjectLiteralArg = (
  arg: ExpressionKind,
): arg is ObjectExpression => arg.type === 'ObjectExpression';

Try / catch

try {
  await updateEffectProps({input, effectIndex, sequenceNodePath, update, schema});
} catch (e) {
  if (e instanceof Error && e.message === 'Cannot update effect prop: computed') {
    // ask the user to inline the props object before editing
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18). Data as JSON: /api/errors/7b5e15a14b50d329. Report an issue: GitHub.

Appendix: source

Thrown at packages/studio-codemods/src/effect-operations.ts:1059

		update.defaultValue !== null &&
		JSON.stringify(update.value) === JSON.stringify(update.defaultValue);
	let object: ObjectExpression;
	if (call.arguments.length === 0) {
		if (isDefault) {
			return {
				serialized: input,
				oldValueString: '',
				newValueString: JSON.stringify(update.defaultValue),
				logLine: call.loc?.start.line ?? jsx.loc?.start.line ?? 1,
				effectCallee,
				removedProps: [],
			};
		}

		object = b.objectExpression([]) as ObjectExpression;
		call.arguments.push(object);
	} else if (call.arguments[0].type !== 'ObjectExpression') {
		throw new Error('Cannot update effect prop: computed');
	} else {
		object = call.arguments[0] as ObjectExpression;
	}

	const existing = findObjectProperty(object, update.key);
	let oldValueString = '';
	if (existing) {
		oldValueString = recast.print(existing.value).code;
	} else if (update.defaultValue !== null) {
		oldValueString = JSON.stringify(update.defaultValue);
	}

	let newValueString = '';
	if (isDefault) {
		newValueString = JSON.stringify(update.defaultValue);
		if (existing) {
			object.properties.splice(object.properties.indexOf(existing), 1);
		}

View on GitHub (pinned to 46a3a6bf13)