remotion-dev/remotion · error
SetTimelineContext is missing. This is likely caused by a Re
Error message
SetTimelineContext is missing. This is likely caused by a Remotion version mismatch.
What it means
SetTimelineContext provides the setFrame function used by Player/composition internals to update the current frame. Its default value throws via missingSetTimelineContext when read. Remotion throws this with an explicit version-mismatch hint because multiple copies of @remotion/core or mismatched core/player versions create separate context instances, so the provider never reaches the consumer.
Source
Thrown at packages/core/src/TimelineContext.tsx:49
export type BufferingState = Readonly<{
buffering: boolean;
}>;
export type SetTimelineContextValue = {
setFrame: (u: React.SetStateAction<Record<string, number>>) => void;
setPlaying: (u: React.SetStateAction<boolean>) => void;
setBuffering: (buffering: boolean) => void;
subscribePlaying: (listener: (state: PlayingState) => void) => () => void;
subscribeBuffering: (listener: (state: BufferingState) => void) => () => void;
isPlaying: () => boolean;
isBuffering: () => boolean;
frameRef: RefObject<Record<string, number>>;
audioAndVideoTags: RefObject<PlayableMediaTag[]>;
};
const missingSetTimelineContext = (): never => {
throw new Error(
'SetTimelineContext is missing. This is likely caused by a Remotion version mismatch.',
);
};
export const SetTimelineContext = createContext<SetTimelineContextValue>({
setFrame: missingSetTimelineContext,
setPlaying: missingSetTimelineContext,
setBuffering: missingSetTimelineContext,
subscribePlaying: () => () => undefined,
subscribeBuffering: () => () => undefined,
isPlaying: () => false,
isBuffering: missingSetTimelineContext,
frameRef: {current: {}},
audioAndVideoTags: {current: []},
});
export const TimelineContext = createContext<TimelineContextValue | null>(null);
View on GitHub (pinned to a6a7485a9a)
Solutions
- Align @remotion/player and @remotion/core to the exact same version
- Run a dedupe (bun install / npm dedupe) so only one copy of @remotion/core exists in node_modules
- Check the bundle for duplicated core modules (bundler analyze / why-did-you-duplicate)
- Use Player/composition hooks only inside a Player or Remotion rendering root
Example fix
// before
"dependencies": {"@remotion/core": "4.0.100", "@remotion/player": "4.0.105"}
// after
"dependencies": {"@remotion/core": "4.0.105", "@remotion/player": "4.0.105"} Defensive patterns
Strategy: type-guard
Validate before calling
// Detect duplicate @remotion/core at startup
const versions = new Set(require.resolve.paths('@remotion/core')?.map((p) => p) ?? []);
// or: bunx npm-why @remotion/core Type guard
const hasSetTimeline = (v: SetTimelineContextValue | undefined): v is SetTimelineContextValue =>
v !== undefined && typeof v.setFrame === 'function' && v.setFrame.length >= 0 &&
!/version mismatch/.test((() => { try { v.setFrame(0); return ''; } catch (e) { return (e as Error).message; } })()); Try / catch
try {
setFrame(frame);
} catch (e) {
if (e instanceof Error && e.message.includes('version mismatch')) {
console.error('Duplicated @remotion/core or mismatched player/core versions');
} else throw e;
} Prevention
- Keep @remotion/core and @remotion/player on the exact same version
- Run npm dedupe / bun install after upgrades to avoid nested core copies
- Never import timeline internals outside a Player/Composition
- Check bundle for multiple core copies after adding dependencies
When it happens
Trigger: Calling setFrame (e.g. from useCurrentFrame-adjacent internals, seeking, or Player controls) when no SetTimelineContext.Provider is above the component — typically because @remotion/core is duplicated in node_modules or player and core versions differ.
Common situations: Using <Player> from @remotion/player with a different version of @remotion/core; bundler resolving a nested node_modules copy of core; using internal timeline hooks outside a Player/Composition.
Related errors
- useCurrentScale() was called outside of a Remotion context.
- AbsoluteTimeContext is not available. This hook must be used
- Tried to enable the buffering state, but a Remotion context
- useCurrentFrame can only be called inside a component that w
- No video config found. Likely reasons:- You are probably cal
AI-assisted analysis of remotion-dev/remotion@a6a7485a9a (2026-09-02).
Data as JSON: /api/errors/af2b6e8d5a823070.
Report an issue: GitHub.