{"record":{"id":"1f9376461b9af739","repo":"DioxusLabs/dioxus","slug":"global-signal-with-key-is-not-of-the-expected","errorCode":null,"errorMessage":"Global signal with key {:?} is not of the expected type. Keys are {:?}","messagePattern":"Global signal with key (.+?) is not of the expected type\\. Keys are (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/signals/src/global/mod.rs","lineNumber":269,"sourceCode":"            column: key.column(),\n            index: 0,\n        }\n    }\n}\n\nimpl From<&'static Location<'static>> for GlobalKey<'static> {\n    fn from(key: &'static Location<'static>) -> Self {\n        Self::new(key)\n    }\n}\n\nimpl GlobalLazyContext {\n    /// Get a signal with the given string key\n    /// The key will be converted to a UUID with the appropriate internal namespace\n    pub fn get_signal_with_key<T: 'static>(&self, key: GlobalKey) -> Option<Signal<T>> {\n        self.map.borrow().get(&key).map(|f| {\n            *f.downcast_ref::<Signal<T>>().unwrap_or_else(|| {\n                panic!(\n                    \"Global signal with key {:?} is not of the expected type. Keys are {:?}\",\n                    key,\n                    self.map.borrow().keys()\n                )\n            })\n        })\n    }\n\n    #[doc(hidden)]\n    /// Clear all global signals of a given type.\n    pub fn clear<T: 'static>(&self) {\n        self.map.borrow_mut().retain(|_k, v| !v.is::<T>());\n    }\n}\n\n/// Get the global context for signals\npub fn get_global_context() -> GlobalLazyContext {\n    let rt = Runtime::current();","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/signals/src/global/mod.rs#L251-L287","documentation":"A global signal looked up by GlobalKey stored a value of a different type than requested. The downcast_ref::<Signal<T>>() failed because the key was first registered with another T; global signal keys are per-type and reusing one with a different type triggers this panic.","triggerScenarios":"Thrown at packages/signals/src/global/mod.rs:269 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A GlobalSignal key was reused with a different type. Use one consistent type per global signal key, or use a distinct key."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}