remotion-dev/remotion · error · Error
You cannot call `getInputProps()` from a
Error message
You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.
What it means
getInputProps() reads props injected by Remotion's runtime via window.remotion_inputProps, which only exists in Studio and server-side rendering. Inside a <Player>, input props are delivered as ordinary React props to the component passed to the component prop, so calling getInputProps() there is meaningless and is rejected to prevent confusion.
Solutions
- In Player-hosted components, read props from the component's own props (function MyComp(props) { const {title} = props; }), not getInputProps().
- Factor out getInputProps() calls so they only run in Studio/SSR builds.
- Branch on environment if a shared hook must serve both contexts.
Example fix
// before
function MyVideo() {
const {title} = getInputProps(); // throws in Player
return <h1>{title}</h1>;
}
<Player component={MyVideo} inputProps={{title: 'Hi'}} />
// after
function MyVideo({title}: {title: string}) {
return <h1>{title}</h1>;
}
<Player component={MyVideo} inputProps={{title: 'Hi'}} /> Defensive patterns
Strategy: validation
Validate before calling
import {getRemotionEnvironment} from 'remotion';
if (!getRemotionEnvironment().isPlayer) {
const props = getInputProps();
} Prevention
- Never call getInputProps() inside a Player-rendered component.
- Read input props from the component's own React props in Player contexts.
- Factor shared logic so the getInputProps() call lives behind an environment check.
When it happens
Trigger: Calling getInputProps() inside a component that is rendered by <Player component={...} />. Also triggered by a shared utility module used in both Studio and Player contexts.
Common situations: Reusing a composition component from a Studio/SSR setup directly inside a Player; copy-pasting a getInputProps() call from a template; helper hooks that call getInputProps unconditionally.
Related errors
- Cannot call `getInputProps()` - window.remotion_inputProps…
- animationData should be provided as an object. If you only…
- blur passed to blurSlide() must be a finite number, received
- blur passed to blurSlide() must be greater than or equal to…
- Caching flag must be a boolean.
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/7bc19266ac09254b.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/config/input-props.ts:32
console.warn(
'Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.',
);
// eslint-disable-next-line no-console
console.warn("To hide this warning, don't call this function on the server:");
// eslint-disable-next-line no-console
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
};
export const getInputProps = <
T extends Record<string, unknown> = Record<string, unknown>,
>(): T => {
if (typeof window === 'undefined') {
warnOnceSSRImport();
return {} as T;
}
if (getRemotionEnvironment().isPlayer) {
throw new Error(
'You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.',
);
}
const override = getInputPropsOverride();
if (override) {
return override as T;
}
if (
typeof window === 'undefined' ||
typeof window.remotion_inputProps === 'undefined'
) {
throw new Error(
'Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.',
);
}
View on GitHub (pinned to 78fe4bb3fd)