remotion-dev/remotion · error

SequenceManagerContext not initialized

Error message

SequenceManagerContext not initialized

What it means

SequenceManager.registerSequence is the default no-op implementation of the React context created in SequenceManager.tsx. Remotion replaces this default with a real <SequenceManager> provider when a composition renders. If the default registerSequence is ever invoked, it means code called sequence registration outside a provider — the context was never initialized by a manager.

Source

Thrown at packages/core/src/SequenceManager.tsx:38

const useIsomorphicLayoutEffect =
	typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;

export type SequenceManagerContext = {
	registerSequence: (seq: TSequence) => void;
	updateSequence: ((seq: TSequence) => void) | null;
	unregisterSequence: (id: string) => void;
	sequences: TSequence[];
};

export type SequenceManagerRef = {
	current: TSequence[];
};

export type SequenceNodePath = Array<string | number>;

export const SequenceManager = React.createContext<SequenceManagerContext>({
	registerSequence: () => {
		throw new Error('SequenceManagerContext not initialized');
	},
	updateSequence: null,
	unregisterSequence: () => {
		throw new Error('SequenceManagerContext not initialized');
	},
	sequences: [],
});

export const SequenceManagerRefContext =
	React.createContext<SequenceManagerRef>({
		current: [],
	});

export const SequenceRegistrationContext = React.createContext(false);

export type VisualModePropStatuses = {
	propStatuses: PropStatuses;
};

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Render the component inside a Remotion composition (wrap with <Composition> / RemotionRoot) so the SequenceManager provider is installed
  2. In tests, use Remotion's test render helpers instead of plain ReactDOM render
  3. Pin all @remotion/* packages to the same version to avoid mismatched context modules
  4. If calling registration APIs directly, provide a SequenceManagerContext.Provider with a real implementation

Example fix

// before
render(<Sequence from={0} durationInFrames={10}><MyComp/></Sequence>);
// after
render(<SequenceManagerProvider><Sequence from={0} durationInFrames={10}><MyComp/></Sequence></SequenceManagerProvider>);
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure the component is rendered inside a Remotion composition root
const insideRemotion = typeof window !== 'undefined' && !!document.querySelector('[data-remotion-root]');

Type guard

const hasSequenceManager = (ctx: unknown): ctx is SequenceManagerContext =>
  ctx !== null && typeof (ctx as SequenceManagerContext).registerSequence === 'function';

Try / catch

try {
  registerSequence(node);
} catch (e) {
  if (e instanceof Error && e.message === 'SequenceManagerContext not initialized') {
    console.warn('Sequence rendered outside Remotion root');
  } else throw e;
}

Prevention

When it happens

Trigger: Calling registerSequence() from useSequenceRegistration (or any consumer of SequenceManager) while rendering outside the Remotion composition root, e.g. rendering <Sequence> in a plain React app or test without the SequenceManager provider.

Common situations: Using @remotion/core components in a plain React app without the Remotion root; unit-testing Sequence components with a bare render() instead of RemotionRoot/test wrappers; version mismatches where an old core renders inside a newer provider setup.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-02). Data as JSON: /api/errors/fdae2a054bc06580. Report an issue: GitHub.