{"record":{"id":"07456fcc5ed43700","repo":"slint-ui/slint","slug":"cannot-get-property-global-name-name-e","errorCode":null,"errorMessage":"Cannot get property {global_name}::{name}: {e}","messagePattern":"Cannot get property (.+?)::(.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/live-preview/live_component.rs","lineNumber":224,"sourceCode":"        self.callbacks.borrow_mut().insert(name.into(), callback.clone());\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    /// forward to set_global_property\n    pub fn set_global_property(&self, global_name: &str, name: &str, value: Value) {\n        self.properties.borrow_mut().insert(format!(\"{global_name}.{name}\"), value.clone());\n        self.instance()\n            .set_global_property(global_name, name, value)\n            .unwrap_or_else(|e| panic!(\"Cannot set property {global_name}::{name}: {e}\"))\n    }\n\n    /// forward to get_global_property\n    pub fn get_global_property(&self, global_name: &str, name: &str) -> Value {\n        self.instance()\n            .get_global_property(global_name, name)\n            .unwrap_or_else(|e| panic!(\"Cannot get property {global_name}::{name}: {e}\"))\n    }\n\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()","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/internal/live-preview/live_component.rs#L206-L242","documentation":"LiveComponent::get_global_property panics when the interpreter cannot read the requested property from the named global singleton. Since the return type is Value (not Result), an unresolvable global/property or type conversion error has no representation other than a panic.","triggerScenarios":"get_global_property with a global name not exported from the component, a property name missing on that global, or when the compiled instance was reloaded and globals were renamed.","commonSituations":"Reading a property before the component instance was successfully created; typos in global or property names; assuming a global exists that the designer removed from the .slint file.","solutions":["Confirm the global is exported and the property is declared (and public) on it","Ensure the LiveComponent compiled and instantiated successfully before reading globals","Re-read after hot-reload only with names still present in the new .slint version"],"exampleFix":"// before\nlet v = live.get_global_property(\"Theme\", \"accent\"); // global renamed to Palette\n// after\nlet v = live.get_global_property(\"Palette\", \"accent\");","handlingStrategy":"validation","validationCode":"let known_globals: Vec<_> = instance.definition().globals().iter().map(|g| g.name.clone()).collect();\ndebug_assert!(known_globals.iter().any(|g| g == \"Palette\"));","typeGuard":null,"tryCatchPattern":"// panic! is not catchable; ensure the instance compiled and the global exists first\nassert!(instance.definition().globals().iter().any(|g| g.name == \"Palette\"));\nlet v = live.get_global_property(\"Palette\", \"accent\");","preventionTips":["Only read globals after successful component compilation/instantiation","Cache global/property names from the ComponentDefinition rather than hardcoding","Re-validate names after hot reloads"],"tags":["rust","live-preview","interpreter","panic"],"backgroundTag":"entity-not-found","analyzedSha":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}