{"record":{"id":"02ffc662ac1fbd00","repo":"slint-ui/slint","slug":"cannot-set-callback-global-name-name-e","errorCode":null,"errorMessage":"Cannot set callback {global_name}::{name}: {e}","messagePattern":"Cannot set callback (.+?)::(.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/live-preview/live_component.rs","lineNumber":244,"sourceCode":"\n    /// Forward to invoke_global\n    pub fn invoke_global(&self, global_name: &str, name: &str, args: &[Value]) -> Value {\n        self.instance()\n            .invoke_global(global_name, name, args)\n            .unwrap_or_else(|e| panic!(\"Cannot invoke callback {global_name}::{name}: {e}\"))\n    }\n\n    /// Forward to set_global_callback\n    pub fn set_global_callback(\n        &self,\n        global_name: &str,\n        name: &str,\n        callback: Rc<dyn Fn(&[Value]) -> Value + 'static>,\n    ) {\n        self.callbacks.borrow_mut().insert(format!(\"{global_name}.{name}\"), callback.clone());\n        self.instance()\n            .set_global_callback(global_name, name, move |args| callback(args))\n            .unwrap_or_else(|e| panic!(\"Cannot set callback {global_name}::{name}: {e}\"));\n    }\n}\n\nenum WatcherState {\n    Starting,\n    /// The file system watcher notified the main thread of a change\n    Changed,\n    /// The main thread is waiting for the next event\n    Waiting(Waker),\n}\n\nstruct Watcher {\n    // (wouldn't need to be an option if new_cyclic() could return errors)\n    watcher: Option<FileWatcher>,\n    state: WatcherState,\n}\n\nimpl Watcher {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/live-preview/live_component.rs#L226-L262","documentation":"Error \"Cannot set callback {global_name}::{name}: {e}\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/live-preview/live_component.rs:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the nested error and match the callback handler's signature to the declaration.","Verify the global and callback names."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}