{"record":{"id":"76388938368b6f40","repo":"slint-ui/slint","slug":"cannot-set-callback-name-e","errorCode":null,"errorMessage":"Cannot set callback {name}: {e}","messagePattern":"Cannot set callback (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/live-preview/live_component.rs","lineNumber":152,"sourceCode":"    pub fn reload_properties_and_callbacks(&self) {\n        // Set the properties\n        for (name, value) in self.properties.borrow_mut().iter() {\n            if let Some((global, prop)) = name.split_once('.') {\n                self.instance()\n                    .set_global_property(global, prop, value.clone())\n                    .unwrap_or_else(|e| panic!(\"Cannot set property {name}: {e}\"));\n            } else {\n                self.instance()\n                    .set_property(name, value.clone())\n                    .unwrap_or_else(|e| panic!(\"Cannot set property {name}: {e}\"));\n            }\n        }\n        for (name, callback) in self.callbacks.borrow_mut().iter() {\n            let callback = callback.clone();\n            if let Some((global, prop)) = name.split_once('.') {\n                self.instance()\n                    .set_global_callback(global, prop, move |args| callback(args))\n                    .unwrap_or_else(|e| panic!(\"Cannot set callback {name}: {e}\"));\n            } else {\n                self.instance()\n                    .set_callback(name, move |args| callback(args))\n                    .unwrap_or_else(|e| panic!(\"Cannot set callback {name}: {e}\"));\n            }\n        }\n\n        eprintln!(\n            \"Reloaded component {} from {}\",\n            self.component_name.as_deref().unwrap_or(\"<default>\"),\n            self.file_name.display()\n        );\n    }\n\n    /// Set a hook that runs after each successful reload, receiving the new instance.\n    pub fn set_post_reload_hook(&mut self, hook: impl Fn(&ComponentInstance) + 'static) {\n        self.post_reload_hook = Some(Box::new(hook));\n    }","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/live-preview/live_component.rs#L134-L170","documentation":"Error \"Cannot set callback {name}: {e}\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/live-preview/live_component.rs:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the nested error and ensure the callback signature matches the declaration.","Verify the callback name exists on the component."],"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-14T05:17:10.506Z"}