{"record":{"id":"320868479845fe59","repo":"reflex-dev/reflex","slug":"default-color-mode-must-be-one-of-allowed-color-m","errorCode":null,"errorMessage":"default_color_mode must be one of {allowed_color_modes}, but got {self.default_color_mode!r}.","messagePattern":"default_color_mode must be one of (.+?), but got (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/config.py","lineNumber":423,"sourceCode":"        # Publish for State-class creation so it never re-enters get_config()\n        # (which AttributeErrors if a State is defined while rxconfig.py is mid-import).\n        global _state_auto_setters\n        _state_auto_setters = self.state_auto_setters\n\n        if (\n            self.state_manager_mode == constants.StateManagerMode.REDIS\n            and not self.redis_url\n        ):\n            msg = f\"{self._prefixes[0]}REDIS_URL is required when using the redis state manager.\"\n            raise ConfigError(msg)\n\n        allowed_color_modes = constants.LiteralColorMode.__args__\n        if self.default_color_mode not in allowed_color_modes:\n            msg = (\n                f\"default_color_mode must be one of \"\n                f\"{allowed_color_modes}, but got {self.default_color_mode!r}.\"\n            )\n            raise ConfigError(msg)\n\n    def _normalize_plugins(self):\n        \"\"\"Normalize ``plugins`` entries to Plugin instances.\n\n        Auto-instantiates Plugin subclasses passed without parentheses (e.g.\n        ``plugins=[SitemapPlugin]``) so they behave the same as\n        ``plugins=[SitemapPlugin()]``. Any entry that is neither a Plugin\n        subclass nor a Plugin instance raises ``ConfigError`` with a message\n        that names the offending value, instead of failing later in the\n        compiler with a confusing ``TypeError`` about a missing ``self``.\n\n        An ``_InvalidPlugin`` (produced when a ``REFLEX_PLUGINS`` import path\n        cannot be resolved) is fatal here: ``plugins`` is an explicit list of\n        plugins the app needs, so a bad entry raises ``InvalidPluginConfigError``\n        and the app cannot start.\n\n        Raises:\n            ConfigError: If an entry is neither a Plugin instance nor subclass.","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/config.py#L405-L441","documentation":"`rx.Config(default_color_mode=...)` only accepts the values in `LiteralColorMode` (typically `\"light\"`, `\"dark\"`, `\"system\"`). Any other string raises a ConfigError at app startup.","triggerScenarios":"`rx.Config(default_color_mode=\"Light\")` (wrong case) or `default_color_mode=\"auto\"` — values not in the literal set.","commonSituations":"Typos/case mismatches, or assuming a value like `\"auto\"` from other libraries; also copying config across Reflex versions where allowed values changed.","solutions":["Use one of the exact values printed in the error, e.g. `\"system\"`","Check the allowed list in the message and fix casing"],"exampleFix":"# before\nrx.Config(default_color_mode=\"auto\")\n\n# after\nrx.Config(default_color_mode=\"system\")","handlingStrategy":"validation","validationCode":"from reflex_base.constants import LiteralColorMode\nimport typing\n\ndef valid_color_mode(v: str) -> str:\n    assert v in typing.get_args(LiteralColorMode), f\"bad color mode {v!r}\"\n    return v\n\nrx.Config(default_color_mode=valid_color_mode(mode))","typeGuard":"from reflex_base.constants import LiteralColorMode\nimport typing\n\ndef is_valid_color_mode(v) -> bool:\n    return v in typing.get_args(LiteralColorMode)","tryCatchPattern":null,"preventionTips":["Copy the exact literal from constants.LiteralColorMode; it is case-sensitive","Validate config values loaded from env vars before passing them to rx.Config"],"tags":["reflex","config","color-mode","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}