{"record":{"id":"69cadc291b19f535","repo":"remotion-dev/remotion","slug":"the-video-tag-requires-a-string-for-src-but","errorCode":null,"errorMessage":"The `<Video>` tag requires a string for `src`, but got ${JSON.stringify(src)} instead.","messagePattern":"The `<Video>` tag requires a string for `src`, but got (.+?) instead\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/media/src/video/video.tsx","lineNumber":104,"sourceCode":"\ttoneFrequency,\n\tshowInTimeline,\n\tdebugOverlay,\n\theadless,\n\tonError,\n\tcredentials,\n\trequestInit,\n\tcontrols,\n\tobjectFit,\n\t_experimentalInitiallyDrawCachedFrame,\n\teffects,\n\tsetMediaDurationInSeconds,\n\trefForOutline,\n\t...props\n}) => {\n\tconst environment = useRemotionEnvironment();\n\n\tif (typeof src !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`The \\`<Video>\\` tag requires a string for \\`src\\`, but got ${JSON.stringify(\n\t\t\t\tsrc,\n\t\t\t)} instead.`,\n\t\t);\n\t}\n\n\tvalidateMediaTrimProps({\n\t\tstartFrom: undefined,\n\t\tendAt: undefined,\n\t\ttrimBefore,\n\t\ttrimAfter,\n\t});\n\n\tconst {trimBeforeValue, trimAfterValue} = resolveTrimProps({\n\t\tstartFrom: undefined,\n\t\tendAt: undefined,\n\t\ttrimBefore,\n\t\ttrimAfter,","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media/src/video/video.tsx#L86-L122","documentation":"Thrown by the public <Video> wrapper in @remotion/media when `src` is present but not a string. Remotion must serialize src into an asset manifest and preload it, so it requires a primitive string; URL objects, numbers, arrays, or any non-string are rejected before media validation runs.","triggerScenarios":"Passing src as a URL object, a number, an object, or any non-string value to <Video>. Also triggered by spreading an any-typed props object whose src field is not a primitive string.","commonSituations":"Passing `new URL(...)` instead of the string form, passing a numeric asset id, or receiving src from an untyped source (parsed JSON, query param) without conversion.","solutions":["Ensure src is a primitive string: <Video src={String(url)} /> or use url.href.","Convert URL objects with .toString() before passing.","Type the composition's src prop strictly as string."],"exampleFix":"// before\n<Video src={new URL('https://example.com/clip.mp4')} />\n\n// after\n<Video src={'https://example.com/clip.mp4'} />","handlingStrategy":"type-guard","validationCode":"const videoSrc = typeof src === 'string' ? src : String(src ?? '');\n<Video src={videoSrc} />;","typeGuard":"const isStringSrc = (v: unknown): v is string => typeof v === 'string';","tryCatchPattern":null,"preventionTips":["Type the src prop as string in your composition interface.","Convert URL objects to strings (.href) before passing.","Avoid spreading any-typed objects into media components."],"tags":["video","src","typeerror","media","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}