remotion-dev/remotion · error · Error
Multiple composition with id ${comp.id} are registered.
Error message
Multiple composition with id ${comp.id} are registered. What it means
Thrown by CompositionManagerProvider.registerComposition when a second composition is registered with an id that already exists in the compositions list. Remotion uses ids as the unique key for the CLI (`--props`, `render <id>`), for Studio routing, and for render selection, so duplicates would create ambiguous resolution. The check fires inside the setCompositions updater so it runs once per composition registration.
Source
Thrown at packages/core/src/CompositionManagerProvider.tsx:64
const updateCompositions = useCallback(
(updateComps: (comp: AnyComposition[]) => AnyComposition[]) => {
setCompositions((comps) => {
const updated = updateComps(comps);
currentcompositionsRef.current = updated;
return updated;
});
},
[],
);
const registerComposition = useCallback(
<Schema extends AnyZodObject, Props extends Record<string, unknown>>(
comp: TComposition<Schema, Props>,
) => {
updateCompositions((comps) => {
if (comps.find((c) => c.id === comp.id)) {
throw new Error(
`Multiple composition with id ${comp.id} are registered.`,
);
}
return [...comps, comp] as AnyComposition[];
});
},
[updateCompositions],
);
const unregisterComposition = useCallback((id: string) => {
setCompositions((comps) => {
return comps.filter((c) => c.id !== id);
});
}, []);
const registerFolder = useCallback(
(View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Search your Root for the id reported in the message (`${comp.id}`) and rename the duplicate.
- If generating compositions from data, derive the id from a guaranteed-unique field (e.g. slug, uuid) rather than title.
- Remove or rename the older entry so each id appears exactly once across <Composition>, <Still>, and <Folder>.
- Run `bunx remotion compositions` after the fix to confirm each id is listed exactly once.
Example fix
// before
<Composition id="intro" component={Intro} ... />
<Composition id="intro" component={IntroV2} ... />
// after
<Composition id="intro" component={Intro} ... />
<Composition id="intro-v2" component={IntroV2} ... /> Defensive patterns
Strategy: validation
Validate before calling
const ids = compositions.map((c) => c.id);
const dupes = ids.filter((id, i) => ids.indexOf(id) !== i);
if (dupes.length > 0) {
throw new Error(`Duplicate composition ids: ${dupes.join(', ')}`);
} Type guard
const hasUniqueIds = (list: ReadonlyArray<{id: string}>): boolean =>
new Set(list.map((c) => c.id)).size === list.length; Prevention
- Centralize composition definitions in a single typed array and dedupe by id at build time.
- Derive ids from guaranteed-unique slugs/uuids when generating from data.
- Add a pre-commit script that fails if any id appears more than once.
- Run `bunx remotion compositions` and visually verify no id repeats.
When it happens
Trigger: Two `<Composition id="x" />` entries in the same Root; dynamically generating compositions from an array where ids collide; copy-paste of a Composition block without renaming the id; a Composition and a Still sharing the same id.
Common situations: Large Root files where ids drift; refactor that splits a file and duplicates an id; programmatic composition generation from a list that has duplicate keys; migration from one project template that leaves a leftover Composition.
Related errors
- No id for composition passed.
- No composition with the ID "${compId}" found.
- Composition id can only contain a-z, A-Z, 0-9, CJK character
- "${name}" must be an object, but you passed a value of type
- "${name}" must be an object, an array was passed ${compositi
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/d719c76fe3a90081.
Report an issue: GitHub.