remotion-dev/remotion · warning

Cannot delete effect: no effects found

Error message

Cannot delete effect: no effects found

What it means

When a deletion target has type 'all-effects', deleteEffects() inspects the resolved effects array and requires at least one element. If the effects={[]} array is empty there is nothing to delete, so it throws this error. This catches attempts to clear an already-empty effects list.

Solutions

  1. Check the effects array has entries (e.g. via the interactivity schema/effect list) before requesting an all-effects delete.
  2. Treat this as a no-op in your UI: if the count is 0, skip the call.
  3. Re-read the source after each mutation so counts are current.

Example fix

// before
await deleteEffects({input, effects: [{type: 'all-effects', sequenceNodePath}]});
// after
if (countEffects(input, sequenceNodePath) > 0) {
  await deleteEffects({input, effects: [{type: 'all-effects', sequenceNodePath}]});
}
Defensive patterns

Strategy: validation

Validate before calling

const count = enumerateEffects(input, sequenceNodePath).length;
if (count === 0) return input; // already empty
await deleteEffects({input, effects: [{type: 'all-effects', sequenceNodePath}]});

Try / catch

try {
  await deleteEffects({input, effects});
} catch (e) {
  if (e instanceof Error && e.message === 'Cannot delete effect: no effects found') return input;
  throw e;
}

Prevention

When it happens

Trigger: deleteEffects({effects: [{type: 'all-effects', sequenceNodePath}]}) where the element's effects array is empty, i.e. effects={[]} — commonly because a previous operation already deleted all effects.

Common situations: Double-invoking a 'delete all effects' action; UI not refreshing the effect count after a prior delete-all; element authored with an empty effects array placeholder.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

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

			});
			const attr = findEffectsAttr(jsx.attributes);
			if (!attr) {
				throw new Error('Could not find effects on the target JSX element');
			}

			const group = effectsByAttribute.get(attr) ?? {
				all: false,
				array: getEffectsArray(attr, 'delete'),
				attributes: jsx.attributes,
				indices: new Set<number>(),
				effectLabels: [],
				logLines: [],
			};
			effectsByAttribute.set(attr, group);
			trackOpeningElement({jsx, snapshots});
			if (effect.type === 'all-effects') {
				if (group.array.elements.length === 0) {
					throw new Error('Cannot delete effect: no effects found');
				}

				const elements = enumerateEffectArrayElements(group.array);
				group.all = true;
				group.indices.clear();
				group.effectLabels = elements.map((element) =>
					element.kind === 'call' ? `${element.callee}()` : 'effect',
				);
				group.logLines = elements.map((element) =>
					element.kind === 'call'
						? (element.node.loc?.start.line ?? attr.loc?.start.line ?? 1)
						: (attr.loc?.start.line ?? 1),
				);
				continue;
			}

			if (group.all || group.indices.has(effect.effectIndex)) {
				continue;

View on GitHub (pinned to 46a3a6bf13)