{"record":{"id":"c311d29f18542a50","repo":"bevyengine/bevy","slug":"cannot-enable-a-plugin-that-does-not-exist","errorCode":null,"errorMessage":"Cannot enable a plugin that does not exist.","messagePattern":"Cannot enable a plugin that does not exist\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_app/src/plugin_group.rs","lineNumber":541,"sourceCode":"        };\n\n        let target_index = target_index + 1;\n\n        self.order.insert(target_index, TypeId::of::<Insert>());\n        self.upsert_plugin_state(plugin, target_index);\n        Ok(self)\n    }\n\n    /// Enables a [`Plugin`].\n    ///\n    /// [`Plugin`]s within a [`PluginGroup`] are enabled by default. This function is used to\n    /// opt back in to a [`Plugin`] after [disabling](Self::disable) it. If there are no plugins\n    /// of type `T` in this group, it will panic.\n    pub fn enable<T: Plugin>(mut self) -> Self {\n        let plugin_entry = self\n            .plugins\n            .get_mut(&TypeId::of::<T>())\n            .expect(\"Cannot enable a plugin that does not exist.\");\n        plugin_entry.enabled = true;\n        self\n    }\n\n    /// Disables a [`Plugin`], preventing it from being added to the [`App`] with the rest of the\n    /// [`PluginGroup`]. The disabled [`Plugin`] keeps its place in the [`PluginGroup`], so it can\n    /// still be used for ordering with [`add_before`](Self::add_before) or\n    /// [`add_after`](Self::add_after), or it can be [re-enabled](Self::enable). If there are no\n    /// plugins of type `T` in this group, it will panic.\n    pub fn disable<T: Plugin>(mut self) -> Self {\n        let plugin_entry = self\n            .plugins\n            .get_mut(&TypeId::of::<T>())\n            .expect(\"Cannot disable a plugin that does not exist.\");\n        plugin_entry.enabled = false;\n        self\n    }\n","sourceCodeStart":523,"sourceCodeEnd":559,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_app/src/plugin_group.rs#L523-L559","documentation":"Panics in PluginGroupBuilder::enable because the plugins map has no entry for TypeId::of::<T>(): there is no plugin of type T in this group to re-enable. Enable is meant to opt back in after disable(), so the plugin must already be part of the group (even if disabled).","triggerScenarios":"Thrown at crates/bevy_app/src/plugin_group.rs:541 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only call enable::<T>() for plugin types that were added to (and possibly disabled in) this PluginGroupBuilder","Check spelling of the generic plugin type parameter","If the plugin may not be in the group, use the non-panicking try-based equivalent if available, or restructure to add it first"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}