remotion-dev/remotion · error
No effects were specified for duplication
Error message
No effects were specified for duplication
What it means
duplicateEffects requires at least one effect target ({effectIndex, sequenceNodePath}) to operate on. It is the batch API behind duplicateEffect; calling it with an empty `effects` array is a caller error and throws immediately, before any parsing occurs.
Solutions
- Guard the effects array length before calling and skip/no-op when empty
- Ensure at least one valid {effectIndex, sequenceNodePath} entry is passed
- If this comes from UI state, re-validate the current selection when the action fires
Example fix
// before
duplicateEffects({input, effects: []});
// after
if (effects.length > 0) { await duplicateEffects({input, effects}); } Defensive patterns
Strategy: validation
Validate before calling
if (!Array.isArray(effects) || effects.length === 0) return null; // no-op instead of calling
duplicateEffects({input, effects}); Type guard
const hasEffects = (e: EffectTarget[]): e is [EffectTarget, ...EffectTarget[]] => e.length > 0;
Try / catch
try { await duplicateEffects({input, effects}); } catch (e) { if ((e as Error).message === 'No effects were specified for duplication') return null; throw e; } Prevention
- Check selection emptiness before dispatching duplicate actions
- Filter invalid targets first; if none remain, skip the call
- Treat empty selection as a UI no-op, not an error path
When it happens
Trigger: Calling duplicateEffects({input, effects: []}); calling duplicateEffect after effects computed asynchronously produced an empty selection.
Common situations: A Studio UI selection that was already emptied (effects deleted elsewhere) before the duplicate action dispatched; filtering out invalid targets leaving an empty list.
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
- Cannot duplicate effect
- Cannot reorder effect: source index not-found
- "colors" must be an array with at least 2 colors, but got
- "colors" must be an array with at least 2 colors, but got
- "colors" must be an array with at least 2 colors, but got
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/2f74a3fce0854546.
Report an issue: GitHub.
Appendix: source
Thrown at packages/studio-codemods/src/effect-operations.ts:463
};
});
export const duplicateEffects = ({
effects,
input,
prettierConfigOverride,
}: {
effects: EffectTarget[];
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 duplication');
}
const ast = parseAst(input);
const snapshots = captureEffectSourceSnapshots(ast);
const effectsByAttribute = new Map<
JSXAttribute,
{
array: ArrayExpression;
indices: Set<number>;
effectLabels: string[];
logLines: number[];
}
>();
for (const {effectIndex, sequenceNodePath} of effects) {
const jsx = getJsx({action: 'duplicate', ast, sequenceNodePath});
const attr = findEffectsAttr(jsx.attributes);
if (!attr) {
throw new Error('Could not find effects on the target JSX element');View on GitHub (pinned to 46a3a6bf13)