{"record":{"id":"d2d93cc3996d1820","repo":"remotion-dev/remotion","slug":"the-frame-prop-of-freeze-must-be-a-finite-nu","errorCode":null,"errorMessage":"The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.","messagePattern":"The 'frame' prop of <Freeze /> must be a finite number, but it is (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/freeze.tsx","lineNumber":47,"sourceCode":"\t\tthrow new Error(\n\t\t\t`The <Freeze /> component requires a 'frame' prop, but none was passed.`,\n\t\t);\n\t}\n\n\tif (typeof frameToFreeze !== 'number') {\n\t\tthrow new Error(\n\t\t\t`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}`,\n\t\t);\n\t}\n\n\tif (Number.isNaN(frameToFreeze)) {\n\t\tthrow new Error(\n\t\t\t`The 'frame' prop of <Freeze /> must be a real number, but it is NaN.`,\n\t\t);\n\t}\n\n\tif (!Number.isFinite(frameToFreeze)) {\n\t\tthrow new Error(\n\t\t\t`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`,\n\t\t);\n\t}\n\n\tconst isActive = useMemo(() => {\n\t\tif (typeof active === 'boolean') {\n\t\t\treturn active;\n\t\t}\n\n\t\tif (typeof active === 'function') {\n\t\t\treturn active(frame);\n\t\t}\n\t}, [active, frame]);\n\n\tconst timelineContext = useTimelineContext();\n\tconst sequenceContext = useContext(SequenceContext);\n\n\tconst relativeFrom = sequenceContext?.relativeFrom ?? 0;","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/freeze.tsx#L29-L65","documentation":"Thrown by <Freeze /> when frame is Infinity or -Infinity. Freeze requires a finite, addressable frame; non-finite values are almost always the result of an unchecked division or a clamp that was never applied.","triggerScenarios":"Passing frame={x / 0}, frame={Infinity}, or the unclamped output of a calculation that escapes the finite range.","commonSituations":"Animations extrapolating beyond an input range without extrapolateLeft/Right='clamp'; formulas dividing by a denominator that can reach zero.","solutions":["Clamp the frame to the video's durationInFrames: frame={Math.min(Math.max(raw, 0), durationInFrames - 1)}.","Guard the denominator in frame arithmetic.","Validate with Number.isFinite(frame) before rendering <Freeze />."],"exampleFix":"// before\nconst frame = value / denominator; // Infinity when denominator is 0\n<Freeze frame={frame}>{scene}</Freeze>\n\n// after\nconst frame = Number.isFinite(value / denominator)\n  ? Math.min(Math.max(value / denominator, 0), durationInFrames - 1)\n  : 0;\n<Freeze frame={frame}>{scene}</Freeze>","handlingStrategy":"validation","validationCode":"const frame = Number.isFinite(rawFrame) ? Math.min(Math.max(rawFrame, 0), durationInFrames - 1) : 0;\nreturn <Freeze frame={frame}>{children}</Freeze>;","typeGuard":"const isFiniteFrame = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":null,"preventionTips":["Clamp computed frames to [0, durationInFrames - 1].","Guard denominators against zero in frame formulas.","Validate with Number.isFinite before rendering <Freeze />."],"tags":["react","component","freeze","props","math"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}