{"record":{"id":"02e5648b33f5e3f8","repo":"remotion-dev/remotion","slug":"no-id-for-composition-passed","errorCode":null,"errorMessage":"No id for composition passed.","messagePattern":"No id for composition passed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/Composition.tsx","lineNumber":193,"sourceCode":"\t\t\t);\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t'<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.',\n\t\t);\n\t}\n\n\tconst {folderName, parentName} = useContext(FolderContext);\n\tconst stack =\n\t\t(compProps as {readonly _remotionInternalStack?: string})\n\t\t\t._remotionInternalStack ?? null;\n\tconst componentFromProps =\n\t\t'component' in compProps ? compProps.component : null;\n\n\tuseEffect(() => {\n\t\t// Ensure it's a URL safe id\n\t\tif (!id) {\n\t\t\tthrow new Error('No id for composition passed.');\n\t\t}\n\n\t\tvalidateCompositionId(id);\n\t\tvalidateDefaultAndInputProps(defaultProps, 'defaultProps', id);\n\t\tregisterComposition<Schema, Props>({\n\t\t\tdurationInFrames: durationInFrames ?? undefined,\n\t\t\tfps: fps ?? undefined,\n\t\t\theight: height ?? undefined,\n\t\t\twidth: width ?? undefined,\n\t\t\tid,\n\t\t\tfolderName,\n\t\t\tcomponent: lazy,\n\t\t\tdefaultProps: serializeThenDeserializeInStudio(\n\t\t\t\t(defaultProps ?? {}) as z.output<Schema> & Props,\n\t\t\t) as InferProps<Schema, Props>,\n\t\t\tnonce: nonce.get(),\n\t\t\tparentFolderName: parentName,\n\t\t\tcomponentFromProps,","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/Composition.tsx#L175-L211","documentation":"Thrown inside a useEffect of the <Composition> component when the required `id` prop is falsy (undefined, null, empty string). The id is used as a URL-safe composition key and as the lookup key for rendering, CLI selection, and Studio routing, so an empty id would break every downstream feature. Remotion validates this lazily at mount time (inside useEffect) so that the error surfaces only after React commits the composition, rather than during render.","triggerScenarios":"Declaring `<Composition />` without an `id` prop, or passing `id={undefined}`/`id={''}`/`id={null}`. This commonly happens when the id is computed from a variable that is undefined at first render, or when spreading props where `id` was never set.","commonSituations":"Refactoring a composition and forgetting to carry the `id` prop; mapping over data and using an index that resolves to undefined; copying a Composition block and deleting the id line by mistake.","solutions":["Add a non-empty string `id` prop to every <Composition> in your Root (e.g. `id=\"MyVideo\"`).","If the id is computed, guard the render with `{data && <Composition id={data.slug} ... />}` so it never mounts with a falsy id.","Run `bunx remotion compositions` to list registered compositions; any missing id will surface before you render.","Check that props are not being spread in a way that overwrites `id` with undefined."],"exampleFix":"// before\n<Composition component={MyVideo} durationInFrames={120} fps={30} width={1920} height={1080} />\n// after\n<Composition id=\"my-video\" component={MyVideo} durationInFrames={120} fps={30} width={1920} height={1080} />","handlingStrategy":"type-guard","validationCode":"// Before rendering the Composition\nconst compositionId: unknown = maybeId;\nif (typeof compositionId !== 'string' || compositionId.length === 0) {\n  throw new Error(`Invalid composition id: ${String(compositionId)}`);\n}\nreturn <Composition id={compositionId} ... />;","typeGuard":"const isCompositionId = (v: unknown): v is string =>\n  typeof v === 'string' && v.length > 0 && /^[A-Za-z0-9-_]+$/.test(v);","tryCatchPattern":null,"preventionTips":["Type your Composition list so `id` is a required non-empty string.","Generate Root.tsx from a typed schema so missing ids fail at compile time.","Run `bunx remotion compositions` in CI to assert every composition has a valid id.","Never spread `{...rest}` onto <Composition> without an explicit `id={...}` line."],"tags":["composition","props","validation","root-registration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}