{"record":{"id":"6552657b27ab8b94","repo":"remotion-dev/remotion","slug":"the-canvas-capture-does-not-contain-cursor-movements","errorCode":null,"errorMessage":"The Canvas Capture does not contain cursor movements","messagePattern":"The Canvas Capture does not contain cursor movements","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio-codemods/src/generate-canvas-capture-composition.ts","lineNumber":113,"sourceCode":"\tvideoHeight,\n\tvideoWidth,\n\twidth,\n}: {\n\treadonly componentName: string;\n\treadonly compositionId: string;\n\treadonly data: CanvasCaptureData;\n\treadonly durationInFrames: number;\n\treadonly fps: number;\n\treadonly height: number;\n\treadonly keyframeFps: number;\n\treadonly videoFileName: string;\n\treadonly videoHeight: number;\n\treadonly videoWidth: number;\n\treadonly width: number;\n}) => {\n\tconst movements = collapseMouseMovementsByFrame({data, keyframeFps});\n\tif (movements.length === 0) {\n\t\tthrow new Error('The Canvas Capture does not contain cursor movements');\n\t}\n\n\tconst cursorKeyframes = movements.reduce<\n\t\tArray<{readonly frame: number; readonly value: string}>\n\t>((keyframes, movement) => {\n\t\tconst value = getCursorName(movement.cursor);\n\t\tif (keyframes.at(-1)?.value !== value) {\n\t\t\tkeyframes.push({frame: movement.frame, value});\n\t\t}\n\n\t\treturn keyframes;\n\t}, []);\n\n\tconst positionKeyframes: Array<{\n\t\treadonly frame: number;\n\t\treadonly value: string;\n\t}> = [];\n\tfor (const movement of movements) {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-codemods/src/generate-canvas-capture-composition.ts#L95-L131","documentation":"generateCanvasCaptureComposition builds a composition source file from Canvas Capture cursor data. After collapsing mouse movements by frame it requires at least one movement; if the recorded data contains no cursor movements there is nothing to render, so it throws this error early with a clear message.","triggerScenarios":"Calling generateCanvasCaptureComposition (directly or via makeNewCompositionComponentSource) with capture data whose mouse-movement samples collapse to zero frames — i.e. data has no cursor positions for the given keyframeFps.","commonSituations":"Recording a Canvas Capture session with no mouse activity; passing data from a keyboard-only or click-less session; wrong data buffer/keyframeFps combination filtering out all movements; loading an empty or wrong export file.","solutions":["Re-record the capture ensuring the mouse actually moves within the recorded region.","Inspect the capture data (data array) and confirm it contains mouse movement entries.","Check keyframeFps — an incorrect value may collapse all movements away.","Verify you are passing the correct capture export, not an empty or unrelated data file."],"exampleFix":"// before\ngenerateCanvasCaptureComposition({data: emptyCapture, keyframeFps: 30, ...}); // throws\n// after\nif (capture.data.length === 0) throw new Error('Capture is empty, re-record');\ngenerateCanvasCaptureComposition({data: capture.data, keyframeFps: 30, ...});","handlingStrategy":"validation","validationCode":"const movements = collapseMouseMovementsByFrame({data, keyframeFps});\nif (movements.length === 0) {\n  throw new Error('Capture has no cursor movements; re-record with mouse activity');\n}","typeGuard":null,"tryCatchPattern":"try {\n  makeNewCompositionComponentSource(capture);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not contain cursor movements')) {\n    console.warn('Empty capture; prompting re-record');\n  } else throw e;\n}","preventionTips":["Verify the capture contains mouse samples before generating compositions","Check keyframeFps matches the recording settings","Guard export/import of captures against empty data files"],"tags":["canvas-capture","cursor","empty-data"],"backgroundTag":"empty-required-field","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}