remotion-dev/remotion · warning

No effects were specified for deletion

Error message

No effects were specified for deletion

What it means

deleteEffects() takes an array of EffectDeletionTarget entries describing which effects to remove. If the effects array argument is empty, there is nothing to delete, so it throws immediately before parsing the AST. This is a guard against no-op API calls that would otherwise produce misleading results.

Solutions

  1. Check effects.length > 0 before calling deleteEffects and no-op otherwise.
  2. Fix the filtering/dedup step that emptied the target list.
  3. If using the single-effect deleteEffect wrapper, ensure an effectIndex/sequenceNodePath was actually supplied.

Example fix

// before
await deleteEffects({input, effects: selectedEffects});
// after
if (selectedEffects.length > 0) {
  await deleteEffects({input, effects: selectedEffects});
}
Defensive patterns

Strategy: validation

Validate before calling

if (effects.length === 0) return input; // no-op
await deleteEffects({input, effects});

Type guard

const hasDeletionTargets = (
  effects: EffectDeletionTarget[],
): effects is [EffectDeletionTarget, ...EffectDeletionTarget[]] => effects.length > 0;

Try / catch

try {
  await deleteEffects({input, effects});
} catch (e) {
  if (e instanceof Error && e.message === 'No effects were specified for deletion') return input;
  throw e;
}

Prevention

When it happens

Trigger: Calling deleteEffects({effects: [], input}) directly; calling the public deleteEffect wrapper after it built an empty selection; batch delete where all targets were filtered out (e.g. already-deleted effects removed from the list) leaving an empty array.

Common situations: UI batch-delete where the selection was cleared but the button stayed enabled; deduplication logic removing all duplicate targets; programming error passing a computed list that ends up empty.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

		};
	});

export const deleteEffects = ({
	effects,
	input,
	prettierConfigOverride,
}: {
	effects: EffectDeletionTarget[];
	input: string;
} & EffectSourceStyleOptions): Promise<{
	output: string;
	formatted: boolean;
	effectLabels: string[];
	logLines: number[];
}> =>
	Promise.resolve().then(() => {
		if (effects.length === 0) {
			throw new Error('No effects were specified for deletion');
		}

		const ast = parseAst(input);
		const snapshots = captureEffectSourceSnapshots(ast);
		const effectsByAttribute = new Map<
			JSXAttribute,
			{
				all: boolean;
				array: ArrayExpression;
				attributes: JSXOpeningElement['attributes'];
				indices: Set<number>;
				effectLabels: string[];
				logLines: number[];
			}
		>();
		for (const effect of effects) {
			const jsx = getJsx({
				action: 'delete',

View on GitHub (pinned to 46a3a6bf13)