{"record":{"id":"ed7495f9d8fc78f8","repo":"remotion-dev/remotion","slug":"key-json-stringify-key-is-not-an-enum","errorCode":null,"errorMessage":"Key ${JSON.stringify(key)} is not an enum","messagePattern":"Key (.+?) is not an enum","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/find-props-to-delete.ts","lineNumber":23,"sourceCode":"\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))\n\t\t\t\t\t.join(', ') +\n\t\t\t\t', got ' +\n\t\t\t\tJSON.stringify(value),\n\t\t);\n\t}\n\n\tconst otherVariants = Object.keys(fieldSchema.variants).filter(\n\t\t(v) => v !== value,","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/find-props-to-delete.ts#L5-L41","documentation":"Thrown by findPropsToDelete when the schema field referenced by `key` exists but is not of type 'enum'. Prop deletion by variant only applies to enum fields; other schema types (e.g. boolean, number, color) cannot be cleared this way.","triggerScenarios":"Calling findPropsToDelete against a schema key whose fieldSchema.type is something other than 'enum' (for example a 'boolean' toggle or a 'color' field).","commonSituations":"Calling the interactive-prop deletion flow on a non-variant field; schema was changed from enum to another type but the caller still treats it as enum.","solutions":["Check `schema[key].type === 'enum'` before calling findPropsToDelete.","Route non-enum fields through their appropriate reset path instead of variant deletion.","If the field should be deletable this way, redefine it in the schema with type: 'enum'.","Update the caller after a schema type change."],"exampleFix":"// before\nfindPropsToDelete({schema, key: 'visible', value: 'true'}); // 'visible' is boolean\n\n// after\nif (schema[key].type === 'enum') {\n  findPropsToDelete({schema, key, value});\n} else {\n  // reset non-enum field through its own path\n}","handlingStrategy":"type-guard","validationCode":"if (schema[key]?.type !== 'enum') {\n  // route non-enum fields to their own reset path\n  return;\n}\nfindPropsToDelete({schema, key, value});","typeGuard":"function isEnumField(field: unknown): field is {type: 'enum'; variants: Record<string, unknown>} {\n  return typeof field === 'object' && field !== null && (field as {type?: string}).type === 'enum';\n}","tryCatchPattern":null,"preventionTips":["Check schema[key].type before calling variant-deletion logic.","Keep a single source of truth for schema field types.","Update callers whenever a field's type changes."],"tags":["interactivity","schema","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}