{"record":{"id":"fecf4b4454c769e2","repo":"remotion-dev/remotion","slug":"the-frame-prop-of-freeze-must-be-a-number-b","errorCode":null,"errorMessage":"The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}","messagePattern":"The 'frame' prop of <Freeze /> must be a number, but is of type (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/freeze.tsx","lineNumber":35,"sourceCode":" * @description Freezes its children at the specified frame when rendering videos.\n * @see [Documentation](https://remotion.dev/docs/freeze)\n */\nexport const Freeze: React.FC<FreezeProps> = ({\n\tframe: frameToFreeze,\n\tchildren,\n\tactive = true,\n}) => {\n\tconst frame = useCurrentFrame();\n\tconst videoConfig = useVideoConfig();\n\n\tif (typeof frameToFreeze === 'undefined') {\n\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') {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/freeze.tsx#L17-L53","documentation":"Thrown by <Freeze /> when the `frame` prop is defined but not a number (e.g. a string like '30'). TypeScript types usually prevent this, but it surfaces at runtime in loosely-typed or serialized input.","triggerScenarios":"Passing frame as a string, object, or boolean; deserializing props from JSON where the number was stringified and not coerced back.","commonSituations":"Input props loaded from JSON/CLI where numbers arrive as strings; dynamic prop injection from untyped sources.","solutions":["Coerce before passing: frame={Number(frameProp)}.","Validate the upstream serialization to preserve numeric types (use Remotion's input-props deserialization rather than raw JSON.parse).","Type the prop source as number so the mismatch is caught at compile time."],"exampleFix":"// before (frame came in as a string from input props)\n<Freeze frame={inputFrame}>{scene}</Freeze>\n\n// after\n<Freeze frame={Number(inputFrame)}>{scene}</Freeze>","handlingStrategy":"type-guard","validationCode":"const frameNum = Number(frameProp);\nif (!Number.isFinite(frameNum)) {\n  throw new Error(`frame must be a finite number, got ${frameProp}`);\n}\nreturn <Freeze frame={frameNum}>{children}</Freeze>;","typeGuard":"const isNumericFrame = (v: unknown): v is number => typeof v === 'number';","tryCatchPattern":null,"preventionTips":["Coerce numeric input props with Number() before passing them as frame.","Use Remotion's input-props deserialization to preserve numeric types.","Type the source as number to catch the mismatch at compile time."],"tags":["react","component","freeze","props","types"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}