{"record":{"id":"c846877c7e5c666f","repo":"reflex-dev/reflex","slug":"invalid-plugin-value-value-r-for-field-name","errorCode":null,"errorMessage":"Invalid plugin value: {value!r} for {field_name}. Plugin name must be in the format 'package.module.PluginName'.","messagePattern":"Invalid plugin value: (.+?) for (.+?)\\. Plugin name must be in the format 'package\\.module\\.PluginName'\\.","errorType":"exception","errorClass":"EnvironmentVarValueError","httpStatus":null,"severity":"error","filePath":"packages/reflex-base/src/reflex_base/environment.py","lineNumber":192,"sourceCode":"\ndef interpret_plugin_class_env(value: str, field_name: str) -> type[Plugin]:\n    \"\"\"Interpret an environment variable value as a Plugin subclass.\n\n    Resolves a fully qualified import path to the Plugin subclass it refers to.\n\n    Args:\n        value: The environment variable value (e.g. \"reflex.plugins.sitemap.SitemapPlugin\").\n        field_name: The field name.\n\n    Returns:\n        The Plugin subclass.\n\n    Raises:\n        EnvironmentVarValueError: If the value is invalid.\n    \"\"\"\n    if \".\" not in value:\n        msg = f\"Invalid plugin value: {value!r} for {field_name}. Plugin name must be in the format 'package.module.PluginName'.\"\n        raise EnvironmentVarValueError(msg)\n\n    import_path, plugin_name = value.rsplit(\".\", 1)\n\n    try:\n        module = importlib.import_module(import_path)\n    except ImportError as e:\n        msg = f\"Failed to import module {import_path!r} for {field_name}: {e}\"\n        raise EnvironmentVarValueError(msg) from e\n\n    try:\n        plugin_class = getattr(module, plugin_name)\n    except Exception as e:\n        msg = f\"Failed to get plugin class {plugin_name!r} from module {import_path!r} for {field_name}: {e}\"\n        raise EnvironmentVarValueError(msg) from e\n\n    if not isinstance(plugin_class, type) or not issubclass(plugin_class, Plugin):\n        msg = f\"Invalid plugin class: {plugin_name!r} for {field_name}. Must be a subclass of Plugin.\"\n        raise EnvironmentVarValueError(msg)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-base/src/reflex_base/environment.py#L174-L210","documentation":"interpret_plugin_class_env parses a dotted plugin path 'package.module.PluginName'; if the string has no dot it cannot be split into module and class, so it raises EnvironmentVarValueError immediately. This is a format validation before any import is attempted.","triggerScenarios":"Setting a plugin env var to a bare class name like 'MyPlugin' or a module name without the class, e.g. 'my_plugins' instead of 'my_plugins.module.MyPlugin'.","commonSituations":"Copying only part of the dotted path, assuming the class name alone resolves, or misunderstanding the required three-part format.","solutions":["Use the full dotted path including the class: 'package.module.PluginName'","Confirm the class actually lives at that module path","Avoid trailing/leading dots or whitespace"],"exampleFix":"# before\nREFLEX_PLUGIN=MyPlugin\n# after\nREFLEX_PLUGIN=my_app.plugins.MyPlugin\n","handlingStrategy":"validation","validationCode":"def is_valid_plugin_path(v: str) -> bool:\n    return v.count(\".\") >= 1 and all(v.split(\".\"))","typeGuard":"def is_valid_plugin_path(v: str) -> bool:\n    parts = v.split(\".\")\n    return len(parts) >= 2 and all(p.isidentifier() for p in parts)","tryCatchPattern":"null","preventionTips":["Document the required 'package.module.Class' format next to the env var","Add a startup assertion on plugin path shape"],"tags":["environment","plugin","validation","import"],"backgroundTag":"plugin-import-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}