{"record":{"id":"44d2266909282645","repo":"reflex-dev/reflex","slug":"reflex-config-plugins-contains-plugin-s-that-coul","errorCode":null,"errorMessage":"reflex.Config.plugins contains plugin(s) that could not be loaded (check REFLEX_PLUGINS import paths): {details}.","messagePattern":"reflex\\.Config\\.plugins contains plugin\\(s\\) that could not be loaded \\(check REFLEX_PLUGINS import paths\\): (.+?)\\.","errorType":"exception","errorClass":"InvalidPluginConfigError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/config.py","lineNumber":474,"sourceCode":"                        f\"reflex.Config.plugins entry {entry.__name__!r} could not be \"\n                        f\"instantiated and may require arguments; pass an instance \"\n                        f\"instead, e.g. plugins=[{entry.__name__}(...)].\"\n                    )\n                    raise InvalidPluginConfigError(msg) from exc\n            else:\n                msg = (\n                    f\"reflex.Config.plugins must contain Plugin instances, but got \"\n                    f\"{entry!r} of type {type(entry).__name__}. \"\n                    f\"Pass an instance, e.g. plugins=[SitemapPlugin()].\"\n                )\n                raise InvalidPluginConfigError(msg)\n        if invalid:\n            details = \", \".join(p.describe() for p in invalid)\n            msg = (\n                f\"reflex.Config.plugins contains plugin(s) that could not be loaded \"\n                f\"(check REFLEX_PLUGINS import paths): {details}.\"\n            )\n            raise InvalidPluginConfigError(msg)\n        self.plugins = normalized\n\n    def _add_extra_plugins(self):\n        \"\"\"Append plugins declared via the ``REFLEX_EXTRA_PLUGINS`` env var.\n\n        Unlike ``REFLEX_PLUGINS``, which *replaces* ``plugins`` entirely, this env\n        var appends to the existing list so plugins configured in ``rxconfig.py``\n        are preserved. Each entry is a fully qualified import path resolved to a\n        Plugin *subclass* (not instantiated by the env machinery). For each class:\n\n        - An invalid import path is warned about and skipped (a bad env entry is\n          never fatal, since the app still has its configured plugins).\n        - A type listed in ``disable_plugins`` is skipped *without* instantiating\n          it, so a disabled plugin never runs its constructor.\n        - A type already present in ``plugins`` is skipped, so a plugin is never\n          run twice.\n        - Otherwise the class is instantiated and appended; a constructor failure\n          is warned about and skipped.","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/config.py#L456-L492","documentation":"One or more plugin instances loaded via the `REFLEX_PLUGINS` environment variable could not be imported/instantiated — their `describe()` output (usually the import path and error) is included in the message. This validation happens after merging env-var plugins into `Config.plugins`.","triggerScenarios":"REFLEX_PLUGINS points at a module path that no longer exists, raises on import (syntax error, missing dependency), or the plugin class moved/renamed.","commonSituations":"Refactoring moved a plugin module, a deployed environment missing a dependency used by a plugin, or stale env var values left in CI/deployment config.","solutions":["Check each path in REFLEX_PLUGINS and verify the module imports cleanly (`uv run python -c \"import myapp.plugins\"`)","Fix the moved/renamed module or update the env var to the new path","Install missing dependencies the plugin needs","Remove the env var entry if the plugin is no longer used"],"exampleFix":"# before\nREFLEX_PLUGINS=myapp.old_plugin_path\n\n# after\nREFLEX_PLUGINS=myapp.plugins.sitemap","handlingStrategy":"validation","validationCode":"import importlib\n\ndef plugins_importable(paths: list[str]) -> None:\n    for p in paths:\n        importlib.import_module(p)  # raises early with a clear ImportError\n\nplugins_importable(os.environ.get(\"REFLEX_PLUGINS\", \"\").split(\",\"))","typeGuard":null,"tryCatchPattern":"from reflex_base.config import InvalidPluginConfigError\n\ntry:\n    app = rx.App()\nexcept InvalidPluginConfigError as e:\n    if \"could not be loaded\" in str(e):\n        os.environ.pop(\"REFLEX_PLUGINS\", None)\n        app = rx.App()  # boot without optional plugins\n    else:\n        raise","preventionTips":["Import-test every REFLEX_PLUGINS path in CI so moves/renames break the build, not prod","Keep plugin modules dependency-light and pinned","Remove stale entries from deployment env vars after refactors"],"tags":["reflex","config","plugins","import-error","env-var"],"backgroundTag":"plugin-import-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}