{"record":{"id":"b50c0eb218360d29","repo":"reflex-dev/reflex","slug":"frontend-compression-formats-contains-unsupported","errorCode":null,"errorMessage":"frontend_compression_formats contains unsupported format {format_name!r}. Expected one of: {', '.join(sorted(supported))}.","messagePattern":"frontend_compression_formats contains unsupported format (.+?)\\. Expected one of: (.+?)\\.","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/config.py","lineNumber":579,"sourceCode":"    def _normalize_frontend_compression_formats(self):\n        \"\"\"Normalize and validate configured frontend compression formats.\n\n        Raises:\n            ConfigError: If an unsupported format name is configured.\n        \"\"\"\n        supported = {\"brotli\", \"gzip\", \"zstd\"}\n        normalized: list[str] = []\n        seen: set[str] = set()\n        for format_name in self.frontend_compression_formats:\n            name = format_name.strip().lower()\n            if not name or name in seen:\n                continue\n            if name not in supported:\n                msg = (\n                    f\"frontend_compression_formats contains unsupported format \"\n                    f\"{format_name!r}. Expected one of: {', '.join(sorted(supported))}.\"\n                )\n                raise ConfigError(msg)\n            normalized.append(name)\n            seen.add(name)\n        self.frontend_compression_formats = normalized\n\n    def _normalize_paths(self):\n        \"\"\"Ensure frontend and backend paths start with a slash if provided.\"\"\"\n        if self.frontend_path and not self.frontend_path.startswith(\"/\"):\n            self.frontend_path = f\"/{self.frontend_path}\"\n\n        if self.backend_path and not self.backend_path.startswith(\"/\"):\n            self.backend_path = f\"/{self.backend_path}\"\n\n    def _add_builtin_plugins(self):\n        \"\"\"Add the builtin plugins to the config.\"\"\"\n        for plugin in _PLUGINS_ENABLED_BY_DEFAULT:\n            plugin_name = plugin.__module__ + \".\" + plugin.__qualname__\n            if plugin not in self.disable_plugins:\n                if not any(isinstance(p, plugin) for p in self.plugins):","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/config.py#L561-L597","documentation":"Raised during Config post-init when the frontend_compression_formats setting contains a format name that is not in the supported set (e.g. 'gzip', 'brotli'). The config normalizes and deduplicates the list, and any unknown entry aborts app startup with a ConfigError. This exists to fail fast on typos before the frontend build pipeline runs.","triggerScenarios":"Setting rx.Config(frontend_compression_formats=[...]) or the corresponding environment variable with a misspelled or unsupported format string, e.g. ['gz'] or ['zstd'] when only 'gzip'/'brotli' are supported. Raised from Config __post_init__ via _normalize_frontend_compression_formats.","commonSituations":"Typos like 'gz' instead of 'gzip', copying a format name from an older/newer Reflex version where the supported set differs, or assuming a format like 'zstd' is supported because a web server supports it.","solutions":["Check the error message: it lists the exact supported formats (sorted); use one of those names","Fix typos, e.g. 'gz' -> 'gzip', 'br' -> 'brotli'","Remove the unsupported entry if the default behavior is acceptable","Verify the name against the Reflex version's supported set (docs or the module defining `supported`)"],"exampleFix":"# before\napp = rx.App(\n    config=rx.Config(frontend_compression_formats=[\"gz\", \"zstd\"])\n)\n# after\napp = rx.App(\n    config=rx.Config(frontend_compression_formats=[\"gzip\", \"brotli\"])\n)","handlingStrategy":"validation","validationCode":"from reflex_base.config import get_supported_compression_formats  # or read the module constant\nfmts = [\"gzip\", \"brotli\"]\nassert set(fmts) <= set(get_supported_compression_formats()), f\"unsupported: {set(fmts) - set(get_supported_compression_formats())}\"","typeGuard":"null","tryCatchPattern":"try:\n    rx.Config(frontend_compression_formats=fmts)\nexcept ConfigError as e:\n    logger.error(\"bad compression formats: %s\", e)\n    fmts = [\"gzip\"]  # safe default","preventionTips":["Validate config values against the supported set listed in the error before constructing Config","Keep compression config in one place and add a unit test asserting the names are supported"],"tags":["config","compression","validation","startup"],"backgroundTag":"config-validation-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}