Idea
When the Remotion Studio / webpack dev server handles a request that 404s (or otherwise does not resolve to a served asset), but a file with the same path suffix exists under the project public/ folder, print a developer-facing message (e.g. on the server console) suggesting to reference it with staticFile() instead of a root-relative URL like /video.mp4.
Motivation
Files in public/ are exposed under the hashed static URL (e.g. /static-<hash>/…), not necessarily at the root path (/video.mp4). Using /video.mp4 in <Video src> or similar often results in 404 even though the file exists in public/. A clear nudge at request time would shorten the debugging loop.
Docs: https://www.remotion.dev/docs/staticfile
Example
- Request:
GET /video.mp4 → 404 (or SPA fallback).
- On disk:
public/video.mp4 exists.
- Expected: log something like:
The file exists in public/ as "video.mp4". Use staticFile("video.mp4") or the correct static URL instead of "/video.mp4".
Scope / notes
- Likely touches the preview server routing and/or fallthrough handler (e.g.
packages/studio-server/src/routes.ts, static serveStatic handling in packages/studio-server/src/preview-server/serve-static.ts).
- Decide when to emit the hint (only on 404? only for GET? debounce noisy paths?).
- Consider matching rules (basename vs full relative path under
public/).
Related
Idea
When the Remotion Studio / webpack dev server handles a request that 404s (or otherwise does not resolve to a served asset), but a file with the same path suffix exists under the project
public/folder, print a developer-facing message (e.g. on the server console) suggesting to reference it withstaticFile()instead of a root-relative URL like/video.mp4.Motivation
Files in
public/are exposed under the hashed static URL (e.g./static-<hash>/…), not necessarily at the root path (/video.mp4). Using/video.mp4in<Video src>or similar often results in 404 even though the file exists inpublic/. A clear nudge at request time would shorten the debugging loop.Docs: https://www.remotion.dev/docs/staticfile
Example
GET /video.mp4→ 404 (or SPA fallback).public/video.mp4exists.The file exists in public/ as "video.mp4". Use staticFile("video.mp4") or the correct static URL instead of "/video.mp4".Scope / notes
packages/studio-server/src/routes.ts, staticserveStatichandling inpackages/studio-server/src/preview-server/serve-static.ts).public/).Related