remotion-dev/remotion · error
Multiple composition with id
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.
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.
- Composition id can only contain a-z, A-Z, 0-9, CJK…
- 'composition' is required.
- " " must be an object, an array was passed "` : ''}
- " " must be an object, but you passed a value of type
AI-assisted analysis of remotion-dev/remotion@a6a7485a9a (2026-09-02).
Data as JSON: /api/errors/d719c76fe3a90081.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/CompositionManagerProvider.tsx:102
return updated;
});
},
[],
);
const registerComposition = useCallback(
<Schema extends AnyZodObject, Props extends Record<string, unknown>>(
comp: TComposition<Schema, Props>,
) => {
const orderKey = getCompositionAndFolderOrderKey({
type: 'composition',
id: comp.id,
});
const internalOrder = nextInternalOrderRef.current++;
internalOrderRef.current.set(orderKey, internalOrder);
updateCompositions((comps) => {
if (comps.find((c) => c.id === comp.id)) {
throw new Error(
`Multiple composition with id ${comp.id} are registered.`,
);
}
return [
...comps,
{
...comp,
order: committedOrderRef.current?.get(orderKey) ?? internalOrder,
},
] as AnyComposition[];
});
},
[updateCompositions],
);
const unregisterComposition = useCallback((id: string) => {
internalOrderRef.current.delete(View on GitHub (pinned to a6a7485a9a)