{"record":{"id":"927bfb5afce938c3","repo":"sinelaw/fresh","slug":"plugin-system-not-active","errorCode":null,"errorMessage":"Plugin system not active","messagePattern":"Plugin system not active","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fresh-editor/src/services/plugins/manager.rs","lineNumber":226,"sourceCode":"\n    /// Load plugins from a directory with config support (no-op when plugins disabled).\n    #[cfg(not(feature = \"plugins\"))]\n    pub fn load_plugins_from_dir_with_config(\n        &self,\n        dir: &Path,\n        plugin_configs: &HashMap<String, PluginConfig>,\n    ) -> (Vec<String>, HashMap<String, PluginConfig>) {\n        let _ = (dir, plugin_configs);\n        (Vec::new(), HashMap::new())\n    }\n\n    /// Unload a plugin by name.\n    pub fn unload_plugin(&self, name: &str) -> anyhow::Result<()> {\n        #[cfg(feature = \"plugins\")]\n        {\n            self.inner\n                .as_ref()\n                .ok_or_else(|| anyhow::anyhow!(\"Plugin system not active\"))?\n                .unload_plugin(name)\n        }\n        #[cfg(not(feature = \"plugins\"))]\n        {\n            let _ = name;\n            Ok(())\n        }\n    }\n\n    /// Load a single plugin by path.\n    pub fn load_plugin(&self, path: &Path) -> anyhow::Result<()> {\n        #[cfg(feature = \"plugins\")]\n        {\n            self.inner\n                .as_ref()\n                .ok_or_else(|| anyhow::anyhow!(\"Plugin system not active\"))?\n                .load_plugin(path)\n        }","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/sinelaw/fresh/blob/67894ca5463dbd7a89bb31add4627c27d6b79d83/crates/fresh-editor/src/services/plugins/manager.rs#L208-L244","documentation":"`PluginManager::unload_plugin` requires the plugins feature: `self.inner` holds the real manager only when the crate is compiled with `#[cfg(feature = \"plugins\")]`. When built without the feature, `inner` is None and unloading fails with \"Plugin system not active\" (when built with the feature but not initialized, the same None triggers it). A no-op Ok(()) is returned instead only in non-plugin builds' cfg branch — the error arm is the cfg(feature) path where inner wasn't initialized.","triggerScenarios":"Calling `unload_plugin(name)` on a manager whose `inner` is None: the binary was compiled without the `plugins` cargo feature wired to inner, or the manager was constructed without initializing the plugin backend.","commonSituations":"Running an official build without the plugins feature and calling plugin-management APIs; config enables a plugin but the binary lacks the feature; forgetting to call the manager's initialization before unload.","solutions":["Rebuild with the plugins feature enabled: `cargo build --features plugins` (or use a build that includes it).","Ensure the plugin manager is initialized at startup so `inner` is Some before unload.","Check the editor's build info to confirm whether plugins are compiled in before enabling plugins in config."],"exampleFix":"// before: built without the feature\ncargo build --release\nlet _ = manager.unload_plugin(\"my-plugin\"); // Plugin system not active\n// after\ncargo build --release --features plugins\nlet _ = manager.unload_plugin(\"my-plugin\");","handlingStrategy":"validation","validationCode":"// caller-side pre-check before touching plugin APIs\nfn plugins_active(m: &PluginManager) -> bool { m.inner.is_some() }","typeGuard":"pub fn is_plugin_ready(m: &PluginManager) -> bool {\n    cfg!(feature = \"plugins\") && m.inner.is_some()\n}","tryCatchPattern":"match manager.unload_plugin(\"my-plugin\") {\n    Err(e) if e.to_string() == \"Plugin system not active\" => {\n        eprintln!(\"this build lacks the plugins feature; rebuild with --features plugins\");\n    }\n    other => other?,\n}","preventionTips":["Build with --features plugins before enabling plugins in config","Gate plugin-management UI/commands on the feature being compiled in","Initialize the plugin manager at startup so inner is Some","Verify feature flags in CI builds that ship plugin support"],"tags":["plugins","feature-flag","compile-time","rust"],"backgroundTag":"feature-not-enabled","analyzedSha":"67894ca5463dbd7a89bb31add4627c27d6b79d83","analyzedAt":"2026-09-13T15:04:03.701Z","contentChangedAt":"2026-09-13T15:04:03.701Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}