{"record":{"id":"3c8b29be71942de1","repo":"reflex-dev/reflex","slug":"childrentypeerror-component-cls-name-child-ch","errorCode":null,"errorMessage":"ChildrenTypeError(component=cls.__name__, child=child)","messagePattern":"ChildrenTypeError\\(component=cls\\.__name__, child=child\\)","errorType":"exception","errorClass":"ChildrenTypeError","httpStatus":null,"severity":"critical","filePath":"packages/reflex-base/src/reflex_base/components/component.py","lineNumber":1291,"sourceCode":"    def _get_components_in_props(self) -> Sequence[BaseComponent]:\n        \"\"\"Get the components in the props.\n\n        Returns:\n            The components in the props\n        \"\"\"\n        return self._get_component_prop_property\n\n    @classmethod\n    def _validate_children(cls, children: tuple | list):\n        from reflex_base.utils.exceptions import ChildrenTypeError\n\n        for child in children:\n            if isinstance(child, (tuple, list)):\n                cls._validate_children(child)\n\n            # Make sure the child is a valid type.\n            if isinstance(child, dict) or not isinstance(child, ComponentChildTypes):\n                raise ChildrenTypeError(component=cls.__name__, child=child)\n\n    @classmethod\n    def create(cls: type[T], *children, **props) -> T:\n        \"\"\"Create the component.\n\n        Args:\n            *children: The children of the component.\n            **props: The props of the component.\n\n        Returns:\n            The component.\n        \"\"\"\n        # Import here to avoid circular imports.\n        from reflex_components_core.base.bare import Bare\n        from reflex_components_core.base.fragment import Fragment\n\n        # Filter out None props\n        props = {key: value for key, value in props.items() if value is not None}","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/components/component.py#L1273-L1309","documentation":"After fetching state from redis, Reflex type-checks the result: the deserialized object must be an instance of the requested state class, otherwise StateMismatchError. This catches schema/full-name collisions where stored state maps to a different class.","triggerScenarios":"Redis returns an object whose class differs from state_cls — e.g. two state classes with the same full name across app versions, or corrupted/mismatched pickle data under a token.","commonSituations":"Deploying a renamed/restructured state while old tokens still exist in redis; multiple apps sharing one redis DB with colliding state names.","solutions":["Flush the stale redis keys / use a distinct redis_db or key prefix per app","Ensure state class names and hierarchy are unique and stable across deployments","Use a proper redis_url per environment so apps don't share tokens"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    st = await self.get_state(OtherState)\nexcept StateMismatchError:\n    # stale/corrupt redis entry for this token\n    await invalidate_token()","preventionTips":["Namespace redis per app (unique redis_db or key prefix)","Avoid redefining state class names across deployments"],"tags":["reflex","redis","state","deserialization"],"backgroundTag":"deserialized-type-mismatch","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}