{"record":{"id":"20949fbbc1014bb9","repo":"DioxusLabs/dioxus","slug":"failed-to-initialize-lazy-value","errorCode":null,"errorMessage":"Failed to initialize lazy value","messagePattern":"Failed to initialize lazy value","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fullstack/src/lazy.rs","lineNumber":102,"sourceCode":"                self.value.wait();\n                return Ok(());\n            }\n\n            // Otherwise, we need to initialize the value\n            self.set(constructor().unwrap())?;\n        }\n        Ok(())\n    }\n\n    /// Get a reference to the value of the `Lazy` instance. This will block the current thread if the\n    /// value is not yet initialized.\n    pub fn get(&self) -> &T {\n        if self.constructor.is_none() {\n            return self.value.get().expect(\"Lazy value is not initialized. Make sure to call `initialize` before dereferencing.\");\n        };\n\n        if self.value.get().is_none() {\n            self.initialize().expect(\"Failed to initialize lazy value\");\n        }\n\n        self.value.get().unwrap()\n    }\n}\n\nimpl<T: Send + Sync + 'static> Default for Lazy<T> {\n    fn default() -> Self {\n        Self::lazy()\n    }\n}\n\nimpl<T: Send + Sync + 'static> std::ops::Deref for Lazy<T> {\n    type Target = T;\n\n    fn deref(&self) -> &Self::Target {\n        self.get()\n    }","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack/src/lazy.rs#L84-L120","documentation":"`Lazy::get` blocks until initialization completes and `expect`s the value to then be present. This panic fires when the lazy value was never initialized despite the constructor being cleared — i.e. `initialize` was not called (or its set step failed) before dereferencing, as the panic text itself explains.","triggerScenarios":"Thrown at packages/fullstack/src/lazy.rs:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the initialization error of the lazy value (e.g. failed fetch or deserialization) and fix the underlying cause before dereferencing it."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}