remotion-dev/remotion · error · Error

Component-owned Element initial props must not override…

Error message

Component-owned Element initial props must not override from, durationInFrames, or name

What it means

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.

Solutions

  1. Remove 'from', 'durationInFrames' and 'name' from initialProps in the request payload
  2. Let the owning component control timing by omitting these props entirely (pass initialProps: null)
  3. Install as a non-component-owned composition if you really need to control these props yourself

Example fix

// before
element.initialProps = { from: 30, durationInFrames: 90, color: 'red' };
// after
element.initialProps = { color: 'red' };
Defensive patterns

Strategy: validation

Validate before calling

const forbidden = ['from', 'durationInFrames', 'name'];
if (componentOwnsSequence && element.initialProps && forbidden.some((k) => Object.hasOwn(element.initialProps, k))) {
  throw new Error('strip from/durationInFrames/name for component-owned elements');
}

Type guard

const hasOwnedKeys = (p: Record<string, unknown> | null): boolean =>
  p !== null && ['from', 'durationInFrames', 'name'].some((k) => Object.hasOwn(p, k));

Try / catch

try {
  await insertElement(payload);
} catch (e) {
  if (/must not override from, durationInFrames, or name/.test(e.message)) {
    payload.element.initialProps = omit(payload.element.initialProps, ['from','durationInFrames','name']);
  }
}

Prevention

When it happens

Trigger: POSTing to the insert-element route with componentOwned sequence installation and initialProps containing keys 'from', 'durationInFrames', or 'name'.

Common situations: 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.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18). Data as JSON: /api/errors/4d406984ba8f74a7. Report an issue: GitHub.

Appendix: source

Thrown at packages/studio-server/src/preview-server/routes/insert-element.ts:100

				(!Number.isInteger(from) || !Number.isFinite(from) || from < 0)
			) {
				throw new Error('from must be a non-negative integer');
			}

			const installationMode =
				element.installationMode === null
					? 'wrapped'
					: element.installationMode;
			const componentOwnsSequence =
				installationMode === 'component-owned-sequence';
			if (
				componentOwnsSequence &&
				element.initialProps !== null &&
				['from', 'durationInFrames', 'name'].some((prop) =>
					Object.hasOwn(element.initialProps ?? {}, prop),
				)
			) {
				throw new Error(
					'Component-owned Element initial props must not override from, durationInFrames, or name',
				);
			}

			if (
				componentOwnsSequence &&
				element.initialProps?.style !== undefined &&
				(element.initialProps.style === null ||
					typeof element.initialProps.style !== 'object' ||
					Array.isArray(element.initialProps.style))
			) {
				throw new Error(
					'Component-owned Element initial style must be an object',
				);
			}

			RenderInternals.Log.trace(
				{indent: false, logLevel},

View on GitHub (pinned to 46a3a6bf13)