remotion-dev/remotion · error
Expected a sequence registration getter
Error message
Expected a sequence registration getter
What it means
useSequenceRegistration registers a <Sequence> with the SequenceManager on mount. It keeps the registration getter in a ref; if registration is enabled but the getter ref is null, the internal invariant is broken and it throws this error, since a sequence without a getter cannot report its position/duration to the manager.
Source
Thrown at packages/core/src/use-sequence-registration.ts:26
}: {
getSequence: (() => TSequence) | null;
id: string;
}) => {
const {registerSequence, unregisterSequence, updateSequence} =
useContext(SequenceManager);
const getSequenceRef = useRef(getSequence);
getSequenceRef.current = getSequence;
const lastRegisteredGetterRef = useRef<(() => TSequence) | null>(null);
const registrationEnabled = getSequence !== null;
useEffect(() => {
if (!registrationEnabled) {
return;
}
const currentGetter = getSequenceRef.current;
if (currentGetter === null) {
throw new Error('Expected a sequence registration getter');
}
registerSequence(currentGetter());
lastRegisteredGetterRef.current = currentGetter;
return () => {
lastRegisteredGetterRef.current = null;
unregisterSequence(id);
};
}, [id, registerSequence, registrationEnabled, unregisterSequence]);
useEffect(() => {
if (
getSequence === null ||
updateSequence === null ||
lastRegisteredGetterRef.current === getSequence
) {
return;View on GitHub (pinned to a6a7485a9a)
Solutions
- Render <Sequence> as-is rather than reimplementing useSequenceRegistration in custom code
- If mocking, provide a valid getter in the context so getSequenceRef.current is non-null before registration
- Ensure the hook's setup effect ordering is preserved (do not conditionally skip ref assignment while enabling registration)
- Upgrade to the latest @remotion/core in case of a fixed internal bug
Defensive patterns
Strategy: type-guard
Validate before calling
if (registrationEnabled && getSequenceRef.current === null) {
throw new Error('Sequence getter missing before registration');
} Type guard
const hasGetter = (ref: React.RefObject<(() => SequenceRegistration) | null>): ref is React.RefObject<() => SequenceRegistration> => ref.current !== null;
Try / catch
try {
registerSequence(getter());
} catch (e) {
if (e instanceof Error && e.message === 'Expected a sequence registration getter') {
// retry after refs are assigned, or skip registration
} else throw e;
} Prevention
- Do not reimplement internal registration hooks in custom components
- Always assign the getter ref before enabling registration
- When mocking context, supply a real getter function
- Keep @remotion/core updated to pick up internal fixes
When it happens
Trigger: registerSequence effect runs while getSequenceRef.current is null — registration was enabled but the component never populated the getter ref (misordered internal setup, custom subclassing, or rendering a Sequence variant outside its normal composition path).
Common situations: Custom Sequence-like components copying internal hooks incorrectly; tests mocking SequenceManagerContext with registrationEnabled true but no getter; internal refactors leaving the ref unset when registration is on.
Related errors
- SequenceManagerContext not initialized
- Should not download a browser in Cloud Run
- Should not download a browser in Cloud Run
- <Clipper> has been removed as of Remotion v4.0.228. The nati
- Remotion requires React.createContext, but it is "undefined"
AI-assisted analysis of remotion-dev/remotion@a6a7485a9a (2026-09-02).
Data as JSON: /api/errors/618bead9e470718a.
Report an issue: GitHub.