{"record":{"id":"ce380f8f3c3180f7","repo":"remotion-dev/remotion","slug":"the-series-component-only-accepts-a-list-of-s","errorCode":null,"errorMessage":"The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string \"${castedChild}\"","messagePattern":"The <Series /> component only accepts a list of <Series\\.Sequence /> components as its children, but you passed a string \"(.+?)\"","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/series/index.tsx","lineNumber":166,"sourceCode":"\t\tconst renderChildren = (i: number, startFrame: number): React.ReactNode => {\n\t\t\tif (i === flattenedChildren.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst child = flattenedChildren[i];\n\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,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/series/index.tsx#L148-L184","documentation":"<Series> flattens its children and validates each is a <Series.Sequence>. A child that is a non-whitespace string (a text node) throws because Series cannot schedule raw text. Whitespace-only strings are silently skipped via `castedChild.trim() === ''`.","triggerScenarios":"<Series>some text</Series>, <Series>{`text`}</Series>, or stray text typed between Sequence children.","commonSituations":"Accidental text/typo between Sequence children; formatting artifacts; editor auto-inserting characters.","solutions":["Remove stray text nodes from <Series> children.","Wrap any real content inside a <Series.Sequence>."],"exampleFix":"// before\n<Series>\n  hello\n  <Series.Sequence durationInFrames={30} />\n</Series>\n// after\n<Series>\n  <Series.Sequence durationInFrames={30} />\n</Series>","handlingStrategy":"validation","validationCode":"// Static lint rule: only <Series.Sequence> as direct children of <Series>.\n// Runtime: flatten children and assert none are non-whitespace strings.","typeGuard":"const isSeriesChild = (\n  c: React.ReactNode,\n): c is React.ReactElement =>\n  typeof c !== 'string' &&\n  React.isValidElement(c) &&\n  (c.type as any) === SeriesSequence;","tryCatchPattern":null,"preventionTips":["Keep <Series> children limited to <Series.Sequence>.","Remove accidental text/whitespace-with-content between sequences.","Review JSX formatting artifacts from editors."],"tags":["series","children","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}