{"record":{"id":"0fb308eba9b25e4a","repo":"remotion-dev/remotion","slug":"you-have-passed-a-playbackrate-of-type-typeof-pr","errorCode":null,"errorMessage":"You have passed a playbackRate of type ${typeof props.playbackRate} to your <${component} /> component. Playback rate must a real number or undefined.","messagePattern":"You have passed a playbackRate of type (.+?) to your <(.+?) /> component\\. Playback rate must a real number or undefined\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-media-props.ts","lineNumber":31,"sourceCode":"\t\ttypeof props.volume !== 'function' &&\n\t\ttypeof props.volume !== 'undefined'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a volume of type ${typeof props.volume} to your <${component} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`,\n\t\t);\n\t}\n\n\tif (typeof props.volume === 'number' && props.volume < 0) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a volume below 0 to your <${component} /> component. Volume must be between 0 and 1`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof props.playbackRate !== 'number' &&\n\t\ttypeof props.playbackRate !== 'undefined'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a playbackRate of type ${typeof props.playbackRate} to your <${component} /> component. Playback rate must a real number or undefined.`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof props.playbackRate === 'number' &&\n\t\t(isNaN(props.playbackRate) ||\n\t\t\t!Number.isFinite(props.playbackRate) ||\n\t\t\tprops.playbackRate <= 0)\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`You have passed a playbackRate of ${props.playbackRate} to your <${component} /> component. Playback rate must be a real number above 0.`,\n\t\t);\n\t}\n\n\tif (\n\t\ttypeof props.preservePitch !== 'boolean' &&\n\t\ttypeof props.preservePitch !== 'undefined'","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-media-props.ts#L13-L49","documentation":"validateMediaProps throws a TypeError when the `playbackRate` prop is neither a number nor undefined (e.g. string, object, null, boolean). Playback rate must be a real positive number or omitted. This guard catches untyped data flowing into <Audio>/<Video> playbackRate.","triggerScenarios":"Passing playbackRate=\"2\" (string), playbackRate={null}, playbackRate={fast:true}, or any non-number from config/URL/JSON sources.","commonSituations":"Reading playbackRate from a URL param or form field (string); deserializing config; loose-typed prop chains; passing a string like '1.5'.","solutions":["Coerce to number: `playbackRate={Number(rawRate)}`.","Validate the type before passing: `typeof r === 'number' ? r : undefined`.","Omit the prop if you do not have a valid number.","Tighten the source type so playbackRate is `number | undefined`."],"exampleFix":"// before\n<Video src={url} playbackRate={config.rate} /> // config.rate is \"2\"\n\n// after\n<Video src={url} playbackRate={Number(config.rate)} />","handlingStrategy":"type-guard","validationCode":"const rate = typeof rawRate === 'string' ? Number(rawRate) : rawRate;\nif (rate != null && typeof rate !== 'number') {\n  throw new TypeError('invalid playbackRate');\n}","typeGuard":"const isValidRate = (r: unknown): r is number | undefined =>\n  r === undefined || typeof r === 'number';","tryCatchPattern":null,"preventionTips":["Coerce string playbackRate to Number before passing.","Type playbackRate as `number | undefined`.","Validate config-derived values at the boundary."],"tags":["remotion","audio","video","playback-rate","validation","typeerror","type-coercion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}