remotion-dev/remotion · critical · Error
Remotion requires React.createContext, but it is…
Error message
Remotion requires React.createContext, but it is "undefined".
If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.
Before:
import {useCurrentFrame} from "remotion";
After:
"use client";
import {useCurrentFrame} from "remotion"; What it means
Thrown at module load time when React.createContext is undefined. This happens inside React Server Components (RSC) where React hooks and context APIs are not available. The message instructs adding the "use client" directive.
Solutions
- Add "use client" as the first line of the file importing remotion.
- Move the remotion import into a dedicated client component and import that component from the server file.
- Ensure your bundler is not stripping React's createContext (check for multiple React versions).
Example fix
// before
import {useCurrentFrame} from "remotion";
export const MyComp = () => {
const f = useCurrentFrame();
return <div>{f}</div>;
};
// after
"use client";
import {useCurrentFrame} from "remotion";
export const MyComp = () => {
const f = useCurrentFrame();
return <div>{f}</div>;
}; Defensive patterns
Strategy: validation
Validate before calling
// At top of any file importing remotion in an RSC framework: // 'use client'; // Must be the very first statement.
Prevention
- Add "use client" as the first line of any module importing remotion in Next.js app router.
- Keep remotion imports in leaf client components, not shared server utilities.
When it happens
Trigger: Importing anything from remotion in a Next.js App Router server component (or any RSC framework) without the "use client" directive at the top of the file.
Common situations: Using remotion in a Next.js 13+ app router page/layout without marking it as a client component; importing remotion utilities from a server-side data-fetching module.
Related errors
- A value of `undefined` was passed to the `component` prop…
- A value of `undefined` was passed to the `lazyComponent`…
- AbsoluteTimeContext is not available. This hook must be…
- animationData should be provided as an object. If you only…
- Changing the AudioContext sample rate dynamically is not…
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/35b7eed9b0e92eb4.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/_check-rsc.ts:16
import {createContext} from 'react';
if (typeof createContext !== 'function') {
const err = [
'Remotion requires React.createContext, but it is "undefined".',
'If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',
'',
'Before:',
' import {useCurrentFrame} from "remotion";',
'',
'After:',
' "use client";',
' import {useCurrentFrame} from "remotion";',
];
throw new Error(err.join('\n'));
}
View on GitHub (pinned to 78fe4bb3fd)