{"record":{"id":"af2b6e8d5a823070","repo":"remotion-dev/remotion","slug":"settimelinecontext-is-missing-this-is-likely-caus","errorCode":null,"errorMessage":"SetTimelineContext is missing. This is likely caused by a Remotion version mismatch.","messagePattern":"SetTimelineContext is missing\\. This is likely caused by a Remotion version mismatch\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/TimelineContext.tsx","lineNumber":49,"sourceCode":"\nexport type BufferingState = Readonly<{\n\tbuffering: boolean;\n}>;\n\nexport type SetTimelineContextValue = {\n\tsetFrame: (u: React.SetStateAction<Record<string, number>>) => void;\n\tsetPlaying: (u: React.SetStateAction<boolean>) => void;\n\tsetBuffering: (buffering: boolean) => void;\n\tsubscribePlaying: (listener: (state: PlayingState) => void) => () => void;\n\tsubscribeBuffering: (listener: (state: BufferingState) => void) => () => void;\n\tisPlaying: () => boolean;\n\tisBuffering: () => boolean;\n\tframeRef: RefObject<Record<string, number>>;\n\taudioAndVideoTags: RefObject<PlayableMediaTag[]>;\n};\n\nconst missingSetTimelineContext = (): never => {\n\tthrow new Error(\n\t\t'SetTimelineContext is missing. This is likely caused by a Remotion version mismatch.',\n\t);\n};\n\nexport const SetTimelineContext = createContext<SetTimelineContextValue>({\n\tsetFrame: missingSetTimelineContext,\n\tsetPlaying: missingSetTimelineContext,\n\tsetBuffering: missingSetTimelineContext,\n\tsubscribePlaying: () => () => undefined,\n\tsubscribeBuffering: () => () => undefined,\n\tisPlaying: () => false,\n\tisBuffering: missingSetTimelineContext,\n\tframeRef: {current: {}},\n\taudioAndVideoTags: {current: []},\n});\n\nexport const TimelineContext = createContext<TimelineContextValue | null>(null);\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/remotion-dev/remotion/blob/a6a7485a9aeb04219510fbe4874f8941486424df/packages/core/src/TimelineContext.tsx#L31-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n\"dependencies\": {\"@remotion/core\": \"4.0.100\", \"@remotion/player\": \"4.0.105\"}\n// after\n\"dependencies\": {\"@remotion/core\": \"4.0.105\", \"@remotion/player\": \"4.0.105\"}","handlingStrategy":"type-guard","validationCode":"// Detect duplicate @remotion/core at startup\nconst versions = new Set(require.resolve.paths('@remotion/core')?.map((p) => p) ?? []);\n// or: bunx npm-why @remotion/core","typeGuard":"const hasSetTimeline = (v: SetTimelineContextValue | undefined): v is SetTimelineContextValue =>\n  v !== undefined && typeof v.setFrame === 'function' && v.setFrame.length >= 0 &&\n  !/version mismatch/.test((() => { try { v.setFrame(0); return ''; } catch (e) { return (e as Error).message; } })());","tryCatchPattern":"try {\n  setFrame(frame);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('version mismatch')) {\n    console.error('Duplicated @remotion/core or mismatched player/core versions');\n  } else throw e;\n}","preventionTips":["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"],"tags":["react","context","version-mismatch","player","timeline"],"backgroundTag":"remotion-version-mismatch","analyzedSha":"a6a7485a9aeb04219510fbe4874f8941486424df","analyzedAt":"2026-09-02T16:25:19.997Z","contentChangedAt":"2026-09-02T16:25:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}