{"record":{"id":"9074e4ee8e1d9a5c","repo":"Textualize/textual","slug":"node-is-missing-data-check-you-are-calling-super","errorCode":null,"errorMessage":"Node is missing data; Check you are calling super().__init__(...) in the {obj.__class__.__name__}() constructor, before getting reactives.","messagePattern":"Node is missing data; Check you are calling super\\(\\)\\.__init__\\(\\.\\.\\.\\) in the (.+?)\\(\\) constructor, before getting reactives\\.","errorType":"exception","errorClass":"ReactiveError","httpStatus":null,"severity":"error","filePath":"src/textual/reactive.py","lineNumber":300,"sourceCode":"            obj_type: type[ReactableType],\n        ) -> ReactiveType: ...\n\n        @overload\n        def __get__(\n            self: Reactive[ReactiveType], obj: None, obj_type: type[ReactableType]\n        ) -> Reactive[ReactiveType]: ...\n\n    def __get__(\n        self: Reactive[ReactiveType],\n        obj: Reactable | None,\n        obj_type: type[ReactableType],\n    ) -> Reactive[ReactiveType] | ReactiveType:\n        _rich_traceback_omit = True\n        if obj is None:\n            # obj is None means we are invoking the descriptor via the class, and not the instance\n            return self\n        if not hasattr(obj, \"id\"):\n            raise ReactiveError(\n                f\"Node is missing data; Check you are calling super().__init__(...) in the {obj.__class__.__name__}() constructor, before getting reactives.\"\n            )\n        if not hasattr(obj, internal_name := self.internal_name):\n            self._initialize_reactive(obj, self.name)\n\n        if hasattr(obj, self.compute_name):\n            value: ReactiveType\n            old_value = getattr(obj, internal_name)\n            value = getattr(obj, self.compute_name)()\n            setattr(obj, internal_name, value)\n            self._check_watchers(obj, self.name, old_value)\n            return value\n        else:\n            return getattr(obj, internal_name)\n\n    def _set(self, obj: Reactable, value: ReactiveType, always: bool = False) -> None:\n        _rich_traceback_omit = True\n","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/Textualize/textual/blob/06dbeef4bb70fb718236aa418ed658ef4667a126/src/textual/reactive.py#L282-L318","documentation":"Reactive getter guard: the object being read has no 'id' attribute, meaning the DOMNode superclass was never initialized. Reactive access requires the data structures that Widget/DOMNode.__init__ sets up.","triggerScenarios":"A custom widget class fails to call super().__init__() (with @parameterized or in a manually managed __init__), then a reactive attribute is read on the instance.","commonSituations":"Custom widgets that define __init__ and forget the super call, or use of functools.partial/parameterized decorators that bypass initialization.","solutions":["Call super().__init__(...) at the start of the custom class's __init__","If using @parameterized, ensure it forwards *args/**kwargs to the real constructor","Avoid reading reactives before construction completes"],"exampleFix":"# before\nclass MyWidget(Static):\n    def __init__(self):\n        self.count = self.counter  # fails\n# after\nclass MyWidget(Static):\n    def __init__(self):\n        super().__init__()\n        self.count = self.counter","handlingStrategy":"validation","validationCode":"assert isinstance(widget, Widget) and hasattr(widget, \"id\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always call super().__init__() in custom widget constructors","Read reactives only after mount"],"tags":["reactive","constructor","init-order","textual"],"backgroundTag":"missing-super-init-call","analyzedSha":"06dbeef4bb70fb718236aa418ed658ef4667a126","analyzedAt":"2026-08-27T02:36:57.214Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}