{"record":{"id":"22f4df00f0001bc1","repo":"remotion-dev/remotion","slug":"could-not-add-sequence-keyframe","errorCode":null,"errorMessage":"Could not add sequence keyframe","messagePattern":"Could not add sequence keyframe","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":1584,"sourceCode":"\t\t\t\t\t\tnodePath: request.nodePath,\n\t\t\t\t\t\tschema: request.schema,\n\t\t\t\t\t\tupdates: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey: request.key,\n\t\t\t\t\t\t\t\toperation: {\n\t\t\t\t\t\t\t\t\ttype: 'add',\n\t\t\t\t\t\t\t\t\tframe: request.frame,\n\t\t\t\t\t\t\t\t\tvalue: JSON.parse(request.value),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\teffectMutations: [],\n\t\t\t});\n\t\t\tconst mutation = result.appliedSequenceMutations[0];\n\t\t\tif (!mutation) {\n\t\t\t\tthrow new Error('Could not add sequence keyframe');\n\t\t\t}\n\n\t\t\treturn getSequenceKeyframeResponse({mutation, project: result.project});\n\t\t},\n\t\taddEffectKeyframe: async (request) => {\n\t\t\tconst result = await commitKeyframeMutations({\n\t\t\t\tlabel: `${request.key} effect keyframe`,\n\t\t\t\tsequenceMutations: [],\n\t\t\t\teffectMutations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfileName: request.fileName,\n\t\t\t\t\t\tsequenceNodePath: request.sequenceNodePath,\n\t\t\t\t\t\teffectIndex: request.effectIndex,\n\t\t\t\t\t\tschema: request.schema,\n\t\t\t\t\t\tupdates: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey: request.key,\n\t\t\t\t\t\t\t\toperation: {","sourceCodeStart":1566,"sourceCodeEnd":1602,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/browser-studio/src/browser-studio-operations.ts#L1566-L1602","documentation":"Rejected by addSequenceKeyframe in @remotion/browser-studio when, after commitKeyframeMutations runs, `result.appliedSequenceMutations[0]` is undefined — i.e. the keyframe 'add' mutation for the given fileName/nodePath/schema was never applied to the project. Unlike the codemod operations, this keyframe operation throws instead of returning a result object, so the promise rejects. The usual cause is a node path or schema that does not match any animatable prop in the current file.","triggerScenarios":"Calling `keyframes.addSequenceKeyframe({fileName, nodePath, schema, key, frame, value})` where nodePath no longer exists in the file (stale after an edit), the schema does not match the prop's current Zod schema, or the target prop is not keyframe-able. `value` must also be valid JSON or JSON.parse throws first.","commonSituations":"Timeline UI adds a keyframe using node paths from a previous render; the component's props schema changed after a reload; the node was moved/deleted by another edit between selection and keyframe click.","solutions":["Refresh node path and schema from the current project state and retry","Confirm the file at fileName still contains the sequence node at nodePath","Make sure `value` is a JSON string that parses to a value accepted by the schema","Wrap the call in try/catch and re-sync your editor state when it rejects"],"exampleFix":"// before\nawait operations.keyframes.addSequenceKeyframe({\n  fileName,\n  nodePath: staleNodePath,\n  schema: staleSchema,\n  key: 'opacity',\n  frame: 30,\n  value: JSON.stringify(0.5),\n});\n\n// after\ntry {\n  await operations.keyframes.addSequenceKeyframe({\n    fileName,\n    nodePath: await getCurrentNodePath(), // freshly resolved\n    schema: await getCurrentSchema(),\n    key: 'opacity',\n    frame: 30,\n    value: JSON.stringify(0.5),\n  });\n} catch (error) {\n  await resyncEditorState();\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await operations.keyframes.addSequenceKeyframe({fileName, nodePath, schema, key, frame, value});\n} catch (error) {\n  // nodePath/schema no longer match the project\n  await resyncEditorState();\n  throw new Error(`Keyframe add failed: ${error instanceof Error ? error.message : String(error)}`);\n}","preventionTips":["Re-resolve nodePath and schema after every applied mutation","Validate `value` with JSON.parse and against the schema before sending","Never queue keyframe adds computed from stale renders"],"tags":["keyframes","node-path","schema","browser-studio"],"backgroundTag":"invalid-node-path","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}