{"record":{"id":"20d458d069f953d4","repo":"remotion-dev/remotion","slug":"no-src-passed-20d458","errorCode":null,"errorMessage":"No src passed","messagePattern":"No src passed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/use-media-in-timeline.ts","lineNumber":51,"sourceCode":"\tplaybackRate,\n\tsequenceDurationInFrames,\n\tmediaStartsAt,\n\tloop,\n}: {\n\tvolume: VolumeProp | undefined;\n\tmediaVolume: number;\n\tmediaType: 'audio' | 'video' | 'image';\n\tsrc: string | undefined;\n\tdisplayName: string | null;\n\ttrimBefore: number | undefined;\n\ttrimAfter: number | undefined;\n\tplaybackRate: number;\n\tsequenceDurationInFrames: number;\n\tmediaStartsAt: number;\n\tloop: boolean;\n}) => {\n\tif (!src) {\n\t\tthrow new Error('No src passed');\n\t}\n\n\tconst parentSequence = useContext(SequenceContext);\n\n\tconst [initialVolume] = useState<VolumeProp | undefined>(() => volume);\n\n\tconst duration = getTimelineDuration({\n\t\tcompositionDurationInFrames: sequenceDurationInFrames,\n\t\tplaybackRate,\n\t\ttrimBefore,\n\t\ttrimAfter,\n\t\tparentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,\n\t\tloop,\n\t});\n\n\tconst volumes: string | number = useMemo(() => {\n\t\tif (typeof volume === 'number') {\n\t\t\treturn volume;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/use-media-in-timeline.ts#L33-L69","documentation":"Thrown synchronously by useBasicMediaInTimeline when its `src` argument is falsy (undefined, null, or empty string). This hook backs Audio/Video/Img timeline registration, so a missing src means there is no media to schedule. It fires during render (not in an effect), so it aborts the component's first render.","triggerScenarios":"Rendering <Audio src={undefined} /> or <Video src={data.url} /> before data.url has loaded; passing an empty string src; destructuring src from a prop that was never provided; conditional media where the source field is optional and currently unset.","commonSituations":"Fetching a media URL asynchronously and rendering the <Video> before the fetch resolves; reading src from a CMS/props object where the field is empty; copy-paste leaving src off; environment differences where an asset path resolves to undefined.","solutions":["Gate the media element on src truthiness: `{url && <Video src={url} />}`.","Initialize the URL state to a valid default asset instead of undefined.","If src is computed, validate it before render and fall back to a placeholder composition.","Check that imported asset paths resolve (e.g. `import vid from './vid.mp4'` is not undefined)."],"exampleFix":"// before\n<Video src={videoUrl} />\n\n// after\n{videoUrl ? <Video src={videoUrl} /> : null}","handlingStrategy":"validation","validationCode":"if (!src || typeof src !== 'string' || src.trim() === '') {\n  return null; // or a placeholder\n}\nreturn <Video src={src} />;","typeGuard":"const isValidSrc = (s: unknown): s is string => typeof s === 'string' && s.length > 0;","tryCatchPattern":null,"preventionTips":["Never render <Audio>/<Video>/<Img> with an unguarded async src; gate on truthiness.","Initialize source state to null and render the media element only once the URL resolves.","Type your props so src is required (not optional) at the call site."],"tags":["remotion","media","audio","video","src","runtime-validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}