remotion-dev/remotion · error · Error

Key ${JSON.stringify(key)} not found in schema

Error message

Key ${JSON.stringify(key)} not found in schema

What it means

Thrown by findPropsToDelete when the `key` argument does not match any top-level field in the supplied InteractivitySchema. This function powers interactive-schema prop deletion (e.g. clearing a variant), so it requires the key to be a declared schema field.

Source

Thrown at packages/core/src/find-props-to-delete.ts:15

import type {InteractivitySchema} from './internals';

export const findPropsToDelete = ({
	schema,
	key,
	value,
}: {
	schema: InteractivitySchema;
	key: string;
	value: unknown;
}) => {
	const fieldSchema = schema[key];

	if (!fieldSchema) {
		throw new Error('Key ' + JSON.stringify(key) + ' not found in schema');
	}

	if (typeof value !== 'string') {
		throw new Error('Value must be a string, but is ' + JSON.stringify(value));
	}

	if (fieldSchema.type !== 'enum') {
		throw new Error('Key ' + JSON.stringify(key) + ' is not an enum');
	}

	const currentVariant = fieldSchema.variants[value as string];
	if (!currentVariant) {
		throw new Error(
			'Value for ' +
				JSON.stringify(key) +
				' must be one of ' +
				Object.keys(fieldSchema.variants)
					.map((v) => JSON.stringify(v))

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Log Object.keys(schema) at the call site and confirm the key you pass is present.
  2. If the key was renamed, update the caller to the new field name.
  3. Guard the call: if (!(key in schema)) return; before invoking findPropsToDelete.
  4. Regenerate or re-fetch the schema if it is loaded dynamically and may be stale.

Example fix

// before
findPropsToDelete({schema, key: 'themColor', value: 'dark'}); // typo

// after
findPropsToDelete({schema, key: 'themeColor', value: 'dark'});
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(key in schema)) {
  console.warn(`Unknown schema key: ${key}`);
  return;
}
findPropsToDelete({schema, key, value});

Type guard

function isKnownSchemaKey(schema: InteractivitySchema, key: string): boolean {
  return Object.prototype.hasOwnProperty.call(schema, key);
}

Prevention

When it happens

Trigger: Calling findPropsToDelete({schema, key: 'foo', value}) where 'foo' is not a property of the schema object; passing a stale schema after the schema was edited but the caller still references an old key name.

Common situations: Renaming or removing a schema field in the studio editor while a stale reference still tries to delete props by the old name; programmatic schema manipulation where the key is derived from user input without validation.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/66ed6ccb3e651b1b. Report an issue: GitHub.