staticFile() does not support relative paths
If you got the following error message:
staticFile() does not support relative paths. Instead, pass the name of a file that is inside the public/ folder.
staticFile() does not support relative paths. Instead, pass the name of a file that is inside the public/ folder.
You have tried to pass a relative path to staticFile()
:
❌ Relative pathtsx
import {staticFile } from "remotion";staticFile ("../public/image.png");
❌ Relative pathtsx
import {staticFile } from "remotion";staticFile ("../public/image.png");
❌ File should not have ./ prefixtsx
import {staticFile } from "remotion";staticFile ("./image.png");
❌ File should not have ./ prefixtsx
import {staticFile } from "remotion";staticFile ("./image.png");
Instead, pass the name of the file that is inside the public folder directly:
✅ Filenametsx
import {staticFile } from "remotion";staticFile ("image.png");
✅ Filenametsx
import {staticFile } from "remotion";staticFile ("image.png");