Skip to main content

staticFile() does not support remote URLs

If you got the following error message:

staticFile() does not support remote URLs. Instead, pass the URL without wrapping it in staticFile().
staticFile() does not support remote URLs. Instead, pass the URL without wrapping it in staticFile().

You have tried to pass a remote URL to staticFile(). You don't need to wrap the path in staticFile, you can pass it directly:

❌ Remote URL inside staticFile()
tsx
import { Img, staticFile } from "remotion";
 
const MyComp = () => {
return <Img src={staticFile("https://example.com/image.png")} />;
};
❌ Remote URL inside staticFile()
tsx
import { Img, staticFile } from "remotion";
 
const MyComp = () => {
return <Img src={staticFile("https://example.com/image.png")} />;
};

Instead, :

✅ Remote URL passed directly
tsx
import { Img } from "remotion";
 
const MyComp = () => {
return <Img src={"https://example.com/image.png"} />;
};
✅ Remote URL passed directly
tsx
import { Img } from "remotion";
 
const MyComp = () => {
return <Img src={"https://example.com/image.png"} />;
};

See also