remotion-dev/remotion · error
No "src" prop was passed to
Error message
No "src" prop was passed to <Img>.
What it means
Thrown by the NativeImgInner component (the path <Img> takes when no `effects` prop is passed) when `src` is falsy. <Img> always requires a `src` because it is responsible for suspending rendering until the image is decoded; an undefined src would silently produce a blank frame. This is the validation guard at the top of the native-rendering branch of <Img>.
Solutions
- Always pass a valid `src` string URL to <Img>.
- Defer rendering: `{url && <Img src={url} />}` so the component never mounts without src.
- Provide a placeholder image URL as a fallback.
- Validate upstream data sources to ensure the src field is non-empty before passing to <Img>.
Example fix
// before
{props.image && <Img alt={props.image.alt} />}
// after
{props.image?.url && <Img src={props.image.url} alt={props.image.alt} />} Defensive patterns
Strategy: type-guard
Validate before calling
if (typeof src !== 'string' || src.length === 0) {
throw new Error(`Missing <Img> src`);
}
return <Img src={src} />; Type guard
const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0;
Prevention
- Conditionally render <Img> only when src is truthy.
- Provide a placeholder src as a fallback.
- Type the src prop as `string` (not optional) in your wrappers.
- Validate CMS/JSON image fields before forwarding to <Img>.
When it happens
Trigger: Rendering `<Img />` without a src prop; passing `src={undefined}` while a value loads; destructuring an object that lacks the src field; passing src from a state variable that is initialized to undefined.
Common situations: Loading images from props where the field is optional; CMS data where the URL field can be empty; conditional rendering forgotten when the asset is missing.
Related errors
- No 'src' was passed to
- The prop cannot be used on when effects are passed, because…
- The "width" and "height" props must be numbers on
- animationData should be provided as an object. If you only…
- blur passed to blurSlide() must be a finite number, received
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/bc1657ba503308dd.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/Img.tsx:385
from,
trimBefore,
durationInFrames,
freeze,
premountFor,
postmountFor,
style,
styleWhilePremounted,
styleWhilePostmounted,
cropLeft,
cropRight,
cropTop,
cropBottom,
controls,
outlineRef: refForOutline,
...props
}) => {
if (!src) {
throw new Error('No "src" prop was passed to <Img>.');
}
const isMedia = useMemo(
() => ({
type: 'image' as const,
src,
}),
[src],
);
const {
effectivePostmountFor,
effectivePremountFor,
freezeFrame,
isPremountingOrPostmounting,
postmountingActive,
premountingActive,
premountingStyle,View on GitHub (pinned to 46a3a6bf13)