{"record":{"id":"394b74f1552c58f6","repo":"remotion-dev/remotion","slug":"component-owned-element-initial-props-must-not-override-from","errorCode":null,"errorMessage":"Component-owned Element initial props must not override from, durationInFrames, or name","messagePattern":"Component-owned Element initial props must not override from, durationInFrames, or name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":2024,"sourceCode":"\t\tgetCompositionFile: (compositionId) =>\n\t\t\tgetCompositionFile({compositionId, project: getProject()}),\n\t\tgetCompositionComponentInfo: (request) =>\n\t\t\tPromise.resolve(\n\t\t\t\tgetCompositionComponentInfo({project: getProject(), request}),\n\t\t\t),\n\t\tinsertElement: async (request) => {\n\t\t\ttry {\n\t\t\t\tconst installationMode = request.element.installationMode ?? 'wrapped';\n\t\t\t\tconst componentOwnsSequence =\n\t\t\t\t\tinstallationMode === 'component-owned-sequence';\n\t\t\t\tif (\n\t\t\t\t\tcomponentOwnsSequence &&\n\t\t\t\t\trequest.element.initialProps !== null &&\n\t\t\t\t\t['from', 'durationInFrames', 'name'].some((prop) =>\n\t\t\t\t\t\tObject.hasOwn(request.element.initialProps ?? {}, prop),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Component-owned Element initial props must not override from, durationInFrames, or name',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcomponentOwnsSequence &&\n\t\t\t\t\trequest.element.initialProps?.style !== undefined &&\n\t\t\t\t\t(request.element.initialProps.style === null ||\n\t\t\t\t\t\ttypeof request.element.initialProps.style !== 'object' ||\n\t\t\t\t\t\tArray.isArray(request.element.initialProps.style))\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Component-owned Element initial style must be an object',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst originalProject = getProject();\n\t\t\t\tlet project = originalProject;","sourceCodeStart":2006,"sourceCodeEnd":2042,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/browser-studio/src/browser-studio-operations.ts#L2006-L2042","documentation":"When installing an Element into a composition whose Sequence is owned by the parent component, the Element's initialProps must not contain keys like 'from', 'durationInFrames', or 'name', because those timing/identity props are controlled by the owning component, not the Element. Overriding them would create a conflict between the component's Sequence placement and the Element's requested props. The operation rejects such a request before applying the codemod.","triggerScenarios":"A browser-studio install/apply request where request.element.initialProps includes from, durationInFrames, or name and the target Sequence is component-owned (componentOwnsSequence).","commonSituations":"Agents or tooling generating Element specs that copy timing props from standalone compositions into component-owned Sequences; migrations of existing Element configs into Studio-managed components.","solutions":["Remove from, durationInFrames, and name from request.element.initialProps and let the owning component control timing.","If timing must change, edit the owning component's Sequence props instead of the Element's initialProps.","Regenerate the request so initialProps only contains visual/prop values."],"exampleFix":"// before\ninitialProps: {from: 30, durationInFrames: 90, color: 'red'}\n// after\ninitialProps: {color: 'red'}","handlingStrategy":"validation","validationCode":"const forbidden = ['from','durationInFrames','name'];\nif (forbidden.some((k) => Object.hasOwn(initialProps ?? {}, k)))\n  throw new Error('initialProps must not override from/durationInFrames/name');","typeGuard":"const hasNoTimingProps = (p: Record<string, unknown> | null): boolean =>\n  !['from','durationInFrames','name'].some((k) => Object.hasOwn(p ?? {}, k));","tryCatchPattern":"try {\n  await applyOperation(request);\n} catch (e) {\n  if (String(e).includes('must not override')) stripTimingProps(request);\n}","preventionTips":["Strip timing keys from initialProps before building install requests.","Let the owning component own Sequence timing.","Validate Element specs with a schema before submitting operations."],"tags":["validation","studio","props"],"backgroundTag":"conflicting-config-options","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"}