{"record":{"id":"15bd55159a781bcd","repo":"bevyengine/bevy","slug":"requested-config-does-not-exist-in-gizmoconfig","errorCode":null,"errorMessage":"Requested config {} does not exist in `GizmoConfigStore`! Did you forget to add it using `app.init_gizmo_group<T>()`?","messagePattern":"Requested config (.+?) does not exist in `GizmoConfigStore`! Did you forget to add it using `app\\.init_gizmo_group<T>\\(\\)`\\?","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_gizmos/src/config.rs","lineNumber":122,"sourceCode":"\nimpl GizmoConfigStore {\n    /// Returns [`GizmoConfig`] and [`GizmoConfigGroup`] associated with [`TypeId`] of a [`GizmoConfigGroup`]\n    pub fn get_config_dyn(&self, config_type_id: &TypeId) -> Option<(&GizmoConfig, &dyn Reflect)> {\n        let (config, ext) = self.store.get(config_type_id)?;\n        Some((config, ext.deref()))\n    }\n\n    /// Returns [`GizmoConfig`] and [`GizmoConfigGroup`] associated with [`GizmoConfigGroup`] `T`\n    ///\n    /// # Panics\n    /// If the config does not exist for [`GizmoConfigGroup`] `T`\n    ///\n    /// For a non-panicking version, see [`get_config`].\n    ///\n    /// [`get_config`]: Self::get_config\n    pub fn config<T: GizmoConfigGroup>(&self) -> (&GizmoConfig, &T) {\n        let Some(configs) = self.get_config() else {\n            panic!(\"Requested config {} does not exist in `GizmoConfigStore`! Did you forget to add it using `app.init_gizmo_group<T>()`?\", T::type_path());\n        };\n        configs\n    }\n\n    /// Returns Some([`GizmoConfig`] and [`GizmoConfigGroup`] associated with [`GizmoConfigGroup`] `T` if they exist,\n    /// else None.\n    ///\n    /// If the configs will always be present, use [`config`].\n    ///\n    /// [`config`]: Self::config\n    pub fn get_config<T: GizmoConfigGroup>(&self) -> Option<(&GizmoConfig, &T)> {\n        let (config, ext) = self.get_config_dyn(&TypeId::of::<T>())?;\n        // hash map invariant guarantees that &dyn Reflect is of correct type T\n        let ext = ext.as_any().downcast_ref().unwrap();\n        Some((config, ext))\n    }\n\n    /// Returns mutable [`GizmoConfig`] and [`GizmoConfigGroup`] associated with [`TypeId`] of a [`GizmoConfigGroup`]","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_gizmos/src/config.rs#L104-L140","documentation":"GizmoConfigStore::config::<T>() panics when no GizmoConfig/GizmoConfigGroup pair has been registered for the group type T. Each gizmo plugin (e.g. LightGizmoPlugin, AabbGizmoPlugin, or your own) registers its group via app.init_gizmo_group::<T>(); the store lookup by TypeId then succeeds. Requesting a group that was never initialized — the message even suggests the fix — aborts with this panic.","triggerScenarios":"Calling gizmo_config_store.config::<MyGroup>() where MyGroup: GizmoConfigGroup was never passed to app.init_gizmo_group::<MyGroup>(); accessing a plugin's config group (e.g. LightGizmoConfigGroup) without adding that gizmo plugin; querying the store in an app that never added any gizmo plugin.","commonSituations":"Custom gizmo groups for debugging overlays where the author forgot init_gizmo_group; conditional debug tooling that reads gizmo configs even when gizmo plugins were feature-gated out; version upgrades renaming or moving config groups between plugins.","solutions":["Register the group at startup: app.init_gizmo_group::<MyGroup>() (uses GizmoConfigGroup::default()).","If the group belongs to a plugin (Light/Aabb/etc.), add that plugin — it registers its group itself.","Use the non-panicking gizmo_config_store.get_config::<T>() (Option) when the group may be absent.","Verify the exact group type parameter — a wrapper vs inner group type mix-up fails the TypeId lookup."],"exampleFix":"// before\nlet (config, group) = store.config::<MyGizmos>(); // panics if never initialized\n\n// after\napp.init_gizmo_group::<MyGizmos>();\n// ...\nlet (config, group) = store.config::<MyGizmos>();\n\n// or optional:\nif let Some((config, group)) = store.get_config::<MyGizmos>() { /* ... */ }","handlingStrategy":"validation","validationCode":"if let Some((config, group)) = gizmo_store.get_config::<MyGroup>() {\n    // safe: group registered\n} else {\n    app.init_gizmo_group::<MyGroup>();\n}","typeGuard":"fn has_gizmo_group<T: GizmoConfigGroup>(store: &GizmoConfigStore) -> bool {\n    store.get_config::<T>().is_some()\n}","tryCatchPattern":null,"preventionTips":["Call app.init_gizmo_group::<T>() in plugin build() for every custom gizmo group.","Add the owning plugin before reading its built-in config groups.","Use get_config (Option) in generic/optional code paths; reserve config() for guaranteed setups."],"tags":["bevy","gizmos","config","panic","debug-drawing"],"backgroundTag":"gizmo-config-not-registered","analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}