{"record":{"id":"4e14916d4cd4c9ac","repo":"streamlit/streamlit","slug":"theme-option-option-name-i-must-be-a-string","errorCode":null,"errorMessage":"Theme option '{option_name}[{i}]' must be a string, got {type(color).__name__}: {color}","messagePattern":"Theme option '(.+?)\\[(.+?)\\]' must be a string, got (.+?): (.+?)","errorType":"validation","errorClass":"StreamlitInvalidThemeOptionError","httpStatus":null,"severity":"error","filePath":"lib/streamlit/config_util.py","lineNumber":277,"sourceCode":"        empty values in the case of arrays.\n\n    Notes\n    -----\n    Logs warnings for potentially invalid colors, since more comprehensive\n    validation happens on the frontend.\n    \"\"\"\n    logger = _get_logger()\n\n    # Handle array color options (chartCategoricalColors, chartSequentialColors)\n    if isinstance(value, list):\n        if not value:\n            raise StreamlitInvalidThemeOptionError(\n                f\"Theme option '{option_name}' cannot be an empty array\"\n            )\n\n        for i, color in enumerate(value):\n            if not isinstance(color, str):\n                raise StreamlitInvalidThemeOptionError(\n                    f\"Theme option '{option_name}[{i}]' must be a string, got {type(color).__name__}: {color}\"\n                )\n\n            color_str = color.strip()\n            if not color_str:\n                raise StreamlitInvalidThemeOptionError(\n                    f\"Theme option '{option_name}[{i}]' cannot be empty\"\n                )\n\n            # Lightweight color validation with warning\n            if not is_css_color_like(color_str):\n                logger.warning(\n                    \"Theme option '%s[%s]' may be an invalid color: %s. \"\n                    \"Expected formats: hex, rgb, and rgba colors\",\n                    option_name,\n                    i,\n                    color_str,\n                )","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/streamlit/streamlit/blob/202661fc552db98c2ba0bb0e113d619689baf9de/lib/streamlit/config_util.py#L259-L295","documentation":"Error \"Theme option '{option_name}[{i}]' must be a string, got {type(color).__name__}: {color}\" thrown in streamlit/streamlit.","triggerScenarios":"Thrown at lib/streamlit/config_util.py:277 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"202661fc552db98c2ba0bb0e113d619689baf9de","analyzedAt":"2026-08-26T09:13:21.291Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}