{"record":{"id":"618bead9e470718a","repo":"remotion-dev/remotion","slug":"expected-a-sequence-registration-getter","errorCode":null,"errorMessage":"Expected a sequence registration getter","messagePattern":"Expected a sequence registration getter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/use-sequence-registration.ts","lineNumber":26,"sourceCode":"}: {\n\tgetSequence: (() => TSequence) | null;\n\tid: string;\n}) => {\n\tconst {registerSequence, unregisterSequence, updateSequence} =\n\t\tuseContext(SequenceManager);\n\tconst getSequenceRef = useRef(getSequence);\n\tgetSequenceRef.current = getSequence;\n\tconst lastRegisteredGetterRef = useRef<(() => TSequence) | null>(null);\n\tconst registrationEnabled = getSequence !== null;\n\n\tuseEffect(() => {\n\t\tif (!registrationEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentGetter = getSequenceRef.current;\n\t\tif (currentGetter === null) {\n\t\t\tthrow new Error('Expected a sequence registration getter');\n\t\t}\n\n\t\tregisterSequence(currentGetter());\n\t\tlastRegisteredGetterRef.current = currentGetter;\n\n\t\treturn () => {\n\t\t\tlastRegisteredGetterRef.current = null;\n\t\t\tunregisterSequence(id);\n\t\t};\n\t}, [id, registerSequence, registrationEnabled, unregisterSequence]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tgetSequence === null ||\n\t\t\tupdateSequence === null ||\n\t\t\tlastRegisteredGetterRef.current === getSequence\n\t\t) {\n\t\t\treturn;","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/remotion-dev/remotion/blob/a6a7485a9aeb04219510fbe4874f8941486424df/packages/core/src/use-sequence-registration.ts#L8-L44","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (registrationEnabled && getSequenceRef.current === null) {\n  throw new Error('Sequence getter missing before registration');\n}","typeGuard":"const hasGetter = (ref: React.RefObject<(() => SequenceRegistration) | null>): ref is React.RefObject<() => SequenceRegistration> =>\n  ref.current !== null;","tryCatchPattern":"try {\n  registerSequence(getter());\n} catch (e) {\n  if (e instanceof Error && e.message === 'Expected a sequence registration getter') {\n    // retry after refs are assigned, or skip registration\n  } else throw e;\n}","preventionTips":["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"],"tags":["react","remotion-core","sequence","invariant"],"backgroundTag":"invariant-violation","analyzedSha":"a6a7485a9aeb04219510fbe4874f8941486424df","analyzedAt":"2026-09-02T16:25:19.997Z","contentChangedAt":"2026-09-02T16:25:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}