{"record":{"id":"66ed6ccb3e651b1b","repo":"remotion-dev/remotion","slug":"key-json-stringify-key-not-found-in-schema","errorCode":null,"errorMessage":"Key ${JSON.stringify(key)} not found in schema","messagePattern":"Key (.+?) not found in schema","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/find-props-to-delete.ts","lineNumber":15,"sourceCode":"import type {InteractivitySchema} from './internals';\n\nexport const findPropsToDelete = ({\n\tschema,\n\tkey,\n\tvalue,\n}: {\n\tschema: InteractivitySchema;\n\tkey: string;\n\tvalue: unknown;\n}) => {\n\tconst fieldSchema = schema[key];\n\n\tif (!fieldSchema) {\n\t\tthrow new Error('Key ' + JSON.stringify(key) + ' not found in schema');\n\t}\n\n\tif (typeof value !== 'string') {\n\t\tthrow new Error('Value must be a string, but is ' + JSON.stringify(value));\n\t}\n\n\tif (fieldSchema.type !== 'enum') {\n\t\tthrow new Error('Key ' + JSON.stringify(key) + ' is not an enum');\n\t}\n\n\tconst currentVariant = fieldSchema.variants[value as string];\n\tif (!currentVariant) {\n\t\tthrow new Error(\n\t\t\t'Value for ' +\n\t\t\t\tJSON.stringify(key) +\n\t\t\t\t' must be one of ' +\n\t\t\t\tObject.keys(fieldSchema.variants)\n\t\t\t\t\t.map((v) => JSON.stringify(v))","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/find-props-to-delete.ts#L1-L33","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Log Object.keys(schema) at the call site and confirm the key you pass is present.","If the key was renamed, update the caller to the new field name.","Guard the call: if (!(key in schema)) return; before invoking findPropsToDelete.","Regenerate or re-fetch the schema if it is loaded dynamically and may be stale."],"exampleFix":"// before\nfindPropsToDelete({schema, key: 'themColor', value: 'dark'}); // typo\n\n// after\nfindPropsToDelete({schema, key: 'themeColor', value: 'dark'});","handlingStrategy":"type-guard","validationCode":"if (!(key in schema)) {\n  console.warn(`Unknown schema key: ${key}`);\n  return;\n}\nfindPropsToDelete({schema, key, value});","typeGuard":"function isKnownSchemaKey(schema: InteractivitySchema, key: string): boolean {\n  return Object.prototype.hasOwnProperty.call(schema, key);\n}","tryCatchPattern":null,"preventionTips":["Derive keys from Object.keys(schema) rather than literals.","After editing a schema, search the codebase for references to removed/renamed fields.","Log schema keys at the call site during development."],"tags":["interactivity","schema","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}