{"record":{"id":"88e1eb6b42bf6b6f","repo":"remotion-dev/remotion","slug":"staticfile-does-not-support-remote-urls-got","errorCode":null,"errorMessage":"staticFile() does not support remote URLs - got \"${path}\". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls","messagePattern":"staticFile\\(\\) does not support remote URLs - got \"(.+?)\"\\. Instead, pass the URL without wrapping it in staticFile\\(\\)\\. See: https://remotion\\.dev/docs/staticfile-remote-urls","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/static-file.ts","lineNumber":101,"sourceCode":"\tconst merged = encodedArray.join('/');\n\treturn merged;\n};\n\n/*\n * @description Reference a file from the public/ folder. If the file does not appear in the autocomplete, type the path manually.\n * @see [Documentation](https://www.remotion.dev/docs/staticfile)\n */\nexport const staticFile = (path: string) => {\n\tif (path === null) {\n\t\tthrow new TypeError('null was passed to staticFile()');\n\t}\n\n\tif (typeof path === 'undefined') {\n\t\tthrow new TypeError('undefined was passed to staticFile()');\n\t}\n\n\tif (path.startsWith('http://') || path.startsWith('https://')) {\n\t\tthrow new TypeError(\n\t\t\t`staticFile() does not support remote URLs - got \"${path}\". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`,\n\t\t);\n\t}\n\n\tif (path.startsWith('..') || path.startsWith('./')) {\n\t\tthrow new TypeError(\n\t\t\t`staticFile() does not support relative paths - got \"${path}\". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`,\n\t\t);\n\t}\n\n\tif (\n\t\tpath.startsWith('/Users') ||\n\t\tpath.startsWith('/home') ||\n\t\tpath.startsWith('/tmp') ||\n\t\tpath.startsWith('/etc') ||\n\t\tpath.startsWith('/opt') ||\n\t\tpath.startsWith('/var') ||\n\t\tpath.startsWith('C:') ||","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/static-file.ts#L83-L119","documentation":"staticFile() only resolves files in your project's public/ folder. It cannot fetch remote URLs because rendering happens offline against local assets, and bundling would not include remote content. This guard detects `http://` or `https://` URLs and points you to the dedicated remote-URL handling pattern.","triggerScenarios":"Calling `staticFile('https://example.com/video.mp4')` or `staticFile('http://cdn.example.com/audio.mp3')`, often by passing a prop that already holds a remote URL into a component that wraps it with staticFile().","commonSituations":"Generic media components that wrap every src in staticFile() being reused with remote URLs; migrating from local to remote assets without updating the consumer.","solutions":["Pass the remote URL directly to the component without staticFile(): `<Img src={remoteUrl} />`.","Branch in your component: `const src = isRemote ? url : staticFile(url);`.","Use the appropriate remote-URL APIs described at https://remotion.dev/docs/staticfile-remote-urls."],"exampleFix":"// before\n<Img src={staticFile(avatarUrl)} />\n\n// after\n<Img src={avatarUrl.startsWith('http') ? avatarUrl : staticFile(avatarUrl)} />","handlingStrategy":"validation","validationCode":"const resolveSrc = (src: string) =>\n  src.startsWith('http://') || src.startsWith('https://')\n    ? src\n    : staticFile(src);","typeGuard":"const isRemoteUrl = (v: string) =>\n  v.startsWith('http://') || v.startsWith('https://');","tryCatchPattern":null,"preventionTips":["Separate local and remote URL handling in your media components.","Document which props accept remote URLs and which require staticFile().","Avoid wrapping every src in staticFile() defensively; branch instead."],"tags":["staticfile","assets","remote-url","url","network"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}