{"record":{"id":"788085e56d910931","repo":"Textualize/textual","slug":"node-is-missing-data-check-you-are-calling-super-788085","errorCode":null,"errorMessage":"Node is missing data; Check you are calling super().__init__(...) in the {obj.__class__.__name__}() constructor, before setting reactives.","messagePattern":"Node is missing data; Check you are calling super\\(\\)\\.__init__\\(\\.\\.\\.\\) in the (.+?)\\(\\) constructor, before setting reactives\\.","errorType":"exception","errorClass":"ReactiveError","httpStatus":null,"severity":"error","filePath":"src/textual/reactive.py","lineNumber":320,"sourceCode":"            )\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\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 setting reactives.\"\n            )\n\n        if isinstance(value, _Mutated):\n            value = value.value\n            always = True\n\n        self._initialize_reactive(obj, self.name)\n\n        if hasattr(obj, self.compute_name):\n            raise AttributeError(\n                f\"Can't set {obj}.{self.name!r}; reactive attributes with a compute method are read-only\"\n            )\n\n        name = self.name\n        current_value = getattr(obj, name)\n        # Check for private and public validate functions.\n        private_validate_function = getattr(obj, f\"_validate_{name}\", None)","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/Textualize/textual/blob/06dbeef4bb70fb718236aa418ed658ef4667a126/src/textual/reactive.py#L302-L338","documentation":"Reactive setter guard: attempting to set a reactive on an object whose DOMNode base was not initialized (missing '_id'). Same root cause as the getter variant but on assignment via __set__ or mutate_reactive.","triggerScenarios":"Assigning to a reactive attribute (obj.value = x) on an instance whose class __init__ never called super().__init__(), or setting reactives inside __init__ before the super call.","commonSituations":"Setting self.some_reactive = ... at the top of a custom widget's __init__ before super().__init__() runs.","solutions":["Move reactive assignments to after super().__init__()","Ensure super().__init__(...) is called unconditionally","Initialize defaults via the reactive's default= or init= parameters instead of assignment in __init__"],"exampleFix":"# before\nclass MyWidget(Static):\n    def __init__(self):\n        self.count = 0  # reactive set before super\n        super().__init__()\n# after\nclass MyWidget(Static):\n    count: reactive[int] = reactive(0)\n    def __init__(self):\n        super().__init__()","handlingStrategy":"validation","validationCode":"if not hasattr(self, \"_id\"):\n    raise RuntimeError(\"call super().__init__() before setting reactives\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use reactive defaults instead of assignment in __init__","Place super().__init__() first in custom constructors"],"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"}