{"record":{"id":"4d406984ba8f74a7","repo":"remotion-dev/remotion","slug":"component-owned-element-initial-props-must-not-override-from-4d4069","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":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio-server/src/preview-server/routes/insert-element.ts","lineNumber":100,"sourceCode":"\t\t\t\t(!Number.isInteger(from) || !Number.isFinite(from) || from < 0)\n\t\t\t) {\n\t\t\t\tthrow new Error('from must be a non-negative integer');\n\t\t\t}\n\n\t\t\tconst installationMode =\n\t\t\t\telement.installationMode === null\n\t\t\t\t\t? 'wrapped'\n\t\t\t\t\t: element.installationMode;\n\t\t\tconst componentOwnsSequence =\n\t\t\t\tinstallationMode === 'component-owned-sequence';\n\t\t\tif (\n\t\t\t\tcomponentOwnsSequence &&\n\t\t\t\telement.initialProps !== null &&\n\t\t\t\t['from', 'durationInFrames', 'name'].some((prop) =>\n\t\t\t\t\tObject.hasOwn(element.initialProps ?? {}, prop),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Component-owned Element initial props must not override from, durationInFrames, or name',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcomponentOwnsSequence &&\n\t\t\t\telement.initialProps?.style !== undefined &&\n\t\t\t\t(element.initialProps.style === null ||\n\t\t\t\t\ttypeof element.initialProps.style !== 'object' ||\n\t\t\t\t\tArray.isArray(element.initialProps.style))\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Component-owned Element initial style must be an object',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tRenderInternals.Log.trace(\n\t\t\t\t{indent: false, logLevel},","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-server/src/preview-server/routes/insert-element.ts#L82-L118","documentation":"When inserting an Element into a composition owned by a component (componentOwnsSequence), the caller may not pass initialProps that override 'from', 'durationInFrames', or 'name', because those are controlled by the owning component. The insert-element route validates the request payload and throws if any of these keys is present in element.initialProps.","triggerScenarios":"POSTing to the insert-element route with componentOwned sequence installation and initialProps containing keys 'from', 'durationInFrames', or 'name'.","commonSituations":"Tooling or an agent generating an insert-element request that copies a full prop set (including timing props) from an existing Sequence without stripping layout/timing props owned by the parent component.","solutions":["Remove 'from', 'durationInFrames' and 'name' from initialProps in the request payload","Let the owning component control timing by omitting these props entirely (pass initialProps: null)","Install as a non-component-owned composition if you really need to control these props yourself"],"exampleFix":"// before\nelement.initialProps = { from: 30, durationInFrames: 90, color: 'red' };\n// after\nelement.initialProps = { color: 'red' };","handlingStrategy":"validation","validationCode":"const forbidden = ['from', 'durationInFrames', 'name'];\nif (componentOwnsSequence && element.initialProps && forbidden.some((k) => Object.hasOwn(element.initialProps, k))) {\n  throw new Error('strip from/durationInFrames/name for component-owned elements');\n}","typeGuard":"const hasOwnedKeys = (p: Record<string, unknown> | null): boolean =>\n  p !== null && ['from', 'durationInFrames', 'name'].some((k) => Object.hasOwn(p, k));","tryCatchPattern":"try {\n  await insertElement(payload);\n} catch (e) {\n  if (/must not override from, durationInFrames, or name/.test(e.message)) {\n    payload.element.initialProps = omit(payload.element.initialProps, ['from','durationInFrames','name']);\n  }\n}","preventionTips":["Strip timing/identity props from initialProps for component-owned installations","Build request payloads from the schema rather than copying full prop sets","Pass initialProps: null when the owning component should control everything"],"tags":["validation","insert-element","sequence-props"],"backgroundTag":"invalid-argument-value","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"}