remotion-dev/remotion · error · Error
No JSX nodes were specified for duplication
Error message
No JSX nodes were specified for duplication
What it means
duplicateJsxNode requires a non-empty array of JSX nodes to duplicate. Passing an empty nodes array is a caller bug and throws immediately.
Source
Thrown at packages/browser-studio/src/browser-studio-operations.ts:1338
throw new Error('Could not delete JSX nodes');
}
return {success: true, nodePathMutation};
} catch (error) {
return {
success: false,
reason: error instanceof Error ? error.message : String(error),
stack: error instanceof Error && error.stack ? error.stack : '',
};
}
};
const duplicateJsxNode: BrowserStudioOperations['duplicateJsxNode'] = async ({
nodes,
}) => {
try {
if (nodes.length === 0) {
throw new Error('No JSX nodes were specified for duplication');
}
const project = getProject();
const nodesByFile = new Map<
string,
(typeof nodes)[number]['nodePath'][]
>();
for (const node of nodes) {
const fileName = findProjectFile({
filePath: node.fileName,
project,
});
const fileNodes = nodesByFile.get(fileName) ?? [];
fileNodes.push(node.nodePath);
nodesByFile.set(fileName, fileNodes);
}
const updates = await Promise.all(View on GitHub (pinned to b2f4e34732)
Solutions
- Guard the call: only invoke duplicateJsxNode when the selection is non-empty
- Fix the caller that builds the nodes array from selection state
- Check for a race where selection was cleared before the operation ran
Example fix
// before
await ops.duplicateJsxNode({nodes});
// after
if (nodes.length > 0) {
await ops.duplicateJsxNode({nodes});
} Defensive patterns
Strategy: validation
Validate before calling
if (nodes.length === 0) { return; /* nothing to duplicate */ } Type guard
const hasNodes = (n: {nodePath: unknown}[]) => n.length > 0; Prevention
- Gate duplicate actions on a non-empty selection in UI handlers
- Clear pending operations when selection changes
When it happens
Trigger: Calling browserStudioOperations.duplicateJsxNode({nodes: []}), e.g. the UI invoking duplicate with an empty selection or a caller mapping over an empty selection list.
Common situations: A keyboard shortcut or context-menu handler firing with no nodes selected, or a selection state that was cleared before the duplicate action ran.
Related errors
- Only HTTP(S) URLs can be imported
- Remote asset exceeds the 50MB size limit
- Remote asset is not a supported image
- Invalid public file path: ${path}
- No JSX nodes were specified for deletion
AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-08-28).
Data as JSON: /api/errors/065d34c2773f147b.
Report an issue: GitHub.