{"record":{"id":"f832b7a8a60d4608","repo":"remotion-dev/remotion","slug":"cannot-paste-effects-no-effects-were-copied","errorCode":null,"errorMessage":"Cannot paste effects: no effects were copied","messagePattern":"Cannot paste effects: no effects were copied","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/studio-codemods/src/effect-operations.ts","lineNumber":895,"sourceCode":"\t\t\t\tinsertAtIndices.length !== calls.length ||\n\t\t\t\tnew Set(insertAtIndices).size !== insertAtIndices.length ||\n\t\t\t\tinsertAtIndices.some((index) => !Number.isInteger(index) || index < 0))\n\t\t) {\n\t\t\tthrow new Error('Cannot paste effects: invalid insertion indices');\n\t\t}\n\n\t\tif (type === 'effects-replacing') {\n\t\t\tif (existingAttr) {\n\t\t\t\tjsx.attributes.splice(jsx.attributes.indexOf(existingAttr), 1);\n\t\t\t}\n\n\t\t\tif (calls.length > 0) {\n\t\t\t\tjsx.attributes.push(\n\t\t\t\t\tmakeEffectsAttr(b.arrayExpression(calls as never) as ArrayExpression),\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (calls.length === 0) {\n\t\t\tthrow new Error('Cannot paste effects: no effects were copied');\n\t\t} else if (insertAtIndices === null) {\n\t\t\tif (existingAttr) {\n\t\t\t\tgetEffectsArray(existingAttr, 'paste').elements.push(\n\t\t\t\t\t...(calls as ArrayExpression['elements']),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tjsx.attributes.push(\n\t\t\t\t\tmakeEffectsAttr(b.arrayExpression(calls as never) as ArrayExpression),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst elements = existingAttr\n\t\t\t\t? getEffectsArray(existingAttr, 'paste').elements\n\t\t\t\t: ([] as ArrayExpression['elements']);\n\t\t\tfor (const item of calls\n\t\t\t\t.map((effect, index) => ({effect, index: insertAtIndices[index]!}))\n\t\t\t\t.sort((a, bValue) => a.index - bValue.index)) {\n\t\t\t\telements.splice(Math.min(item.index, elements.length), 0, item.effect);","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-codemods/src/effect-operations.ts#L877-L913","documentation":"In non-replacing paste modes (additive), if the clipboard produced zero effect calls the library cannot paste anything and throws this error. Only 'effects-replacing' may legitimately result in zero effects (it just removes the existing effects attribute).","triggerScenarios":"Calling pasteEffects with type 'effects-additive' (or null insertAtIndices additive mode) and an empty effects array — e.g. the clipboard/copy step captured nothing, or all copied effects were filtered out before the paste call.","commonSituations":"Copy action that silently failed or copied an element with an empty effects array; clipboard state reset but paste invoked; an app bug clearing the copied effects list between copy and paste.","solutions":["Check the copied effects list is non-empty before enabling or invoking paste.","Fix the copy step so it actually captures effect entries from the source element.","If a paste with zero effects should be a silent no-op in your UI, guard the call."],"exampleFix":"// before\nawait pasteEffects({input, targetSequenceNodePath, effects: clipboard.effects, type: 'effects-additive', insertAtIndices: null});\n// after\nif (clipboard.effects.length > 0) {\n  await pasteEffects({input, targetSequenceNodePath, effects: clipboard.effects, type: 'effects-additive', insertAtIndices: null});\n}","handlingStrategy":"validation","validationCode":"if (type !== 'effects-replacing' && clipboardEffects.length === 0) {\n  return; // nothing to paste\n}","typeGuard":"const hasCopiedEffects = (\n  effects: EffectClipboardEntry[],\n): effects is [EffectClipboardEntry, ...EffectClipboardEntry[]] => effects.length > 0;","tryCatchPattern":"try {\n  await pasteEffects(args);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Cannot paste effects: no effects were copied') {\n    // surface 'clipboard empty' to the user\n  } else throw e;\n}","preventionTips":["Verify the copy step actually captured effect entries.","Disable paste UI while the clipboard effect list is empty."],"tags":["empty-input","clipboard","studio"],"backgroundTag":"empty-required-field","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"}