{"record":{"id":"68cbd0e085726837","repo":"remotion-dev/remotion","slug":"the-series-component-only-accepts-a-list-of-s-68cbd0","errorCode":null,"errorMessage":"The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead","messagePattern":"The <Series /> component only accepts a list of <Series\\.Sequence /> components as its children, but got (.+?) instead","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/series/index.tsx","lineNumber":172,"sourceCode":"\t\t\tconst castedChild = child as unknown as\n\t\t\t\t| {\n\t\t\t\t\t\tprops: InternalSeriesSequenceProps;\n\t\t\t\t\t\ttype: typeof SeriesSequence;\n\t\t\t\t  }\n\t\t\t\t| string;\n\t\t\tif (typeof castedChild === 'string') {\n\t\t\t\t// Don't throw if it's just some accidential whitespace\n\t\t\t\tif (castedChild.trim() === '') {\n\t\t\t\t\treturn renderChildren(i + 1, startFrame);\n\t\t\t\t}\n\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string \"${castedChild}\"`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (castedChild.type !== SeriesSequence) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst castedElement = castedChild as React.ReactElement<\n\t\t\t\tInternalSeriesSequenceProps,\n\t\t\t\ttypeof SeriesSequence\n\t\t\t>;\n\t\t\tvalidateSeriesSequenceProps({\n\t\t\t\tdurationInFrames: castedElement.props.durationInFrames,\n\t\t\t\toffset: castedElement.props.offset,\n\t\t\t\tindex: i,\n\t\t\t\tchildrenLength: flattenedChildren.length,\n\t\t\t});\n\n\t\t\treturn React.cloneElement(castedElement, {\n\t\t\t\t_remotionInternalRender: (resolvedProps, ref) => {\n\t\t\t\t\tconst durationInFramesProp = resolvedProps.durationInFrames;","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/series/index.tsx#L154-L190","documentation":"After the string check, each child's `type` must equal `SeriesSequence`. Any other React element type (a <div>, <Img>, custom component, or the core <Sequence>) throws because Series needs Series.Sequence to read its durationInFrames/offset props.","triggerScenarios":"<Series><div/></Series>, <Series><MyComp/></Series>, or <Series><Sequence/></Series> using the plain core Sequence instead of Series.Sequence.","commonSituations":"Using core <Sequence> where <Series.Sequence> is required; nesting arbitrary components directly under <Series>.","solutions":["Use <Series.Sequence> for every direct child of <Series>.","Move non-sequence content inside a <Series.Sequence>'s children."],"exampleFix":"// before\n<Series>\n  <Sequence durationInFrames={30}><Content/></Sequence>\n</Series>\n// after\n<Series>\n  <Series.Sequence durationInFrames={30}><Content/></Series.Sequence>\n</Series>","handlingStrategy":"validation","validationCode":"React.Children.forEach(children, (c) => {\n  if (React.isValidElement(c) && c.type !== SeriesSequence) {\n    throw new TypeError('Direct <Series> child must be <Series.Sequence>');\n  }\n});","typeGuard":"const isSeriesSequence = (\n  el: React.ReactElement,\n): boolean => (el.type as any) === SeriesSequence;","tryCatchPattern":null,"preventionTips":["Use <Series.Sequence>, not the core <Sequence>, under <Series>.","Wrap arbitrary content inside a <Series.Sequence>'s children.","Add a type check helper when building series children programmatically."],"tags":["series","children","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}