{"record":{"id":"037ee2db2c06b20a","repo":"bevyengine/bevy","slug":"does-not-exist-in-this-plugingroup","errorCode":null,"errorMessage":"{} does not exist in this PluginGroup","messagePattern":"(.+?) does not exist in this PluginGroup","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_app/src/plugin_group.rs","lineNumber":364,"sourceCode":"                .order\n                .iter()\n                .enumerate()\n                .find(|(i, ty)| *i != added_at_index && **ty == key)\n                .map(|(i, _)| i)\n            {\n                self.order.remove(to_remove);\n            }\n        }\n    }\n\n    /// Sets the value of the given [`Plugin`], if it exists.\n    ///\n    /// # Panics\n    ///\n    /// Panics if the [`Plugin`] does not exist.\n    pub fn set<T: Plugin>(self, plugin: T) -> Self {\n        self.try_set(plugin).unwrap_or_else(|_| {\n            panic!(\n                \"{} does not exist in this PluginGroup\",\n                core::any::type_name::<T>(),\n            )\n        })\n    }\n\n    /// Tries to set the value of the given [`Plugin`], if it exists.\n    ///\n    /// If the given plugin doesn't exist returns self and the passed in [`Plugin`].\n    pub fn try_set<T: Plugin>(mut self, plugin: T) -> Result<Self, (Self, T)> {\n        match self.plugins.entry(TypeId::of::<T>()) {\n            Entry::Occupied(mut entry) => {\n                entry.get_mut().plugin = Box::new(plugin);\n\n                Ok(self)\n            }\n            Entry::Vacant(_) => Err((self, plugin)),\n        }","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_app/src/plugin_group.rs#L346-L382","documentation":"Panics in PluginGroupBuilder::set when try_set fails because no plugin of type T exists in the group being built. The builder cannot replace the configuration of a plugin it does not contain; the type must have been added to the group first.","triggerScenarios":"Thrown at crates/bevy_app/src/plugin_group.rs:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the plugin to the PluginGroup (via add/add_before/add_after) before calling set on it","Check that you are calling set on the correct PluginGroupBuilder instance","If the plugin may legitimately be absent, use try_set and handle the Err case instead of set"],"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"}