{"record":{"id":"fa7ee2bbdd02e347","repo":"remotion-dev/remotion","slug":"this-component-must-be-inside-a-series-compone","errorCode":null,"errorMessage":"This component must be inside a <Series /> component.","messagePattern":"This component must be inside a <Series /> component\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/series/is-inside-series.tsx","lineNumber":28,"sourceCode":"\t\t\t{children}\n\t\t</IsInsideSeriesContext.Provider>\n\t);\n};\n\nexport const IsNotInsideSeriesProvider: React.FC<{\n\treadonly children: React.ReactNode;\n}> = ({children}) => {\n\treturn (\n\t\t<IsInsideSeriesContext.Provider value={false}>\n\t\t\t{children}\n\t\t</IsInsideSeriesContext.Provider>\n\t);\n};\n\nexport const useRequireToBeInsideSeries = () => {\n\tconst isInsideSeries = React.useContext(IsInsideSeriesContext);\n\tif (!isInsideSeries) {\n\t\tthrow new Error('This component must be inside a <Series /> component.');\n\t}\n};\n","sourceCodeStart":10,"sourceCodeEnd":31,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/series/is-inside-series.tsx#L10-L31","documentation":"Series-context hooks (useRequireToBeInsideSeries) read IsInsideSeriesContext, which <Series> sets to true for its descendants and which the <IsOutsideSeries> provider sets to false. If the context is false/absent, calling such a hook throws to enforce that these APIs only run within a <Series>.","triggerScenarios":"Using a Series-context hook or Series-only component outside any <Series> ancestor; refactoring that removes the <Series> wrapper around a child that still expects it.","commonSituations":"Copy-pasting a Series child component into a non-series area; splitting a composition and forgetting to keep the <Series> parent.","solutions":["Wrap the consuming component in a <Series>.","Use the standalone (non-series) equivalent of the component/hook if one exists."],"exampleFix":"// before\n<SeriesChild />\n// after\n<Series>\n  <Series.Sequence durationInFrames={30}><SeriesChild/></Series.Sequence>\n</Series>","handlingStrategy":"type-guard","validationCode":"// Structure-only guard: ensure the component is only rendered under <Series>.\n// React Context default is false, so misuse throws at render time by design.","typeGuard":"// No runtime type guard needed; the hook itself enforces via context.\n// Structural fix: only mount these components inside <Series>.","tryCatchPattern":null,"preventionTips":["Always render Series-context components under <Series>.","When refactoring, keep the <Series> wrapper around moved children.","Use the standalone equivalent when not in a series."],"tags":["series","context","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}