{"record":{"id":"6a029b5e6090440f","repo":"emilk/egui","slug":"failed-to-get-interaction","errorCode":null,"errorMessage":"Failed to get interaction","messagePattern":"Failed to get interaction","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/egui/src/memory/mod.rs","lineNumber":1026,"sourceCode":"\n    /// Forget window positions, sizes etc.\n    /// Can be used to auto-layout windows.\n    pub fn reset_areas(&mut self) {\n        #[expect(clippy::iter_over_hash_type)]\n        for area in self.areas.values_mut() {\n            *area = Default::default();\n        }\n    }\n\n    /// Obtain the previous rectangle of an area.\n    pub fn area_rect(&self, id: impl Into<Id>) -> Option<Rect> {\n        self.areas().get(id.into()).map(|state| state.rect())\n    }\n\n    pub(crate) fn interaction(&self) -> &InteractionState {\n        self.interactions\n            .get(&self.viewport_id)\n            .expect(\"Failed to get interaction\")\n    }\n\n    pub(crate) fn interaction_mut(&mut self) -> &mut InteractionState {\n        self.interactions.entry(self.viewport_id).or_default()\n    }\n\n    pub(crate) fn focus(&self) -> Option<&Focus> {\n        self.focus.get(&self.viewport_id)\n    }\n\n    pub(crate) fn focus_mut(&mut self) -> &mut Focus {\n        self.focus.entry(self.viewport_id).or_default()\n    }\n\n    /// Check if the widget owns IME events.\n    ///\n    /// A widget should only consume IME events if this returns `true`. At most\n    /// one widget can own IME events for each frame.","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/emilk/egui/blob/1a9d2af9efde043883036a6c0fc52423df435398/crates/egui/src/memory/mod.rs#L1008-L1044","documentation":"Error \"Failed to get interaction\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/egui/src/memory/mod.rs:1022 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The interaction snapshot is missing for this pass: don't access Memory interaction state outside a UI pass; read it from within update."],"exampleFix":"// Access interaction state inside the app update:\nfn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { let _ = ctx.memory(|m| m.interaction()); }","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1a9d2af9efde043883036a6c0fc52423df435398","analyzedAt":"2026-08-19T12:39:57.743Z","contentChangedAt":"2026-08-19T12:39:57.743Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}