{"record":{"id":"193d7f467322214f","repo":"zed-industries/zed","slug":"failed-to-append-input-to-body-e","errorCode":null,"errorMessage":"Failed to append input to body: {e:?}","messagePattern":"Failed to append input to body: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_web/src/window.rs","lineNumber":161,"sourceCode":"\n    #[allow(clippy::too_many_arguments)]\n    pub(crate) fn new(\n        _handle: AnyWindowHandle,\n        _params: WindowParams,\n        context: &WgpuContext,\n        canvas: web_sys::HtmlCanvasElement,\n        surface: wgpu::Surface<'static>,\n        browser_window: web_sys::Window,\n        lifecycle: Rc<Cell<WebWindowLifecycle>>,\n        active_window: Rc<RefCell<Option<AnyWindowHandle>>>,\n    ) -> anyhow::Result<Self> {\n        let document = browser_window\n            .document()\n            .ok_or_else(|| anyhow::anyhow!(\"No `document` found on window\"))?;\n        let body = document\n            .body()\n            .ok_or_else(|| anyhow::anyhow!(\"No `body` found on document\"))?;\n        let dpr = browser_window.device_pixel_ratio() as f32;\n        let max_texture_dimension = context.device.limits().max_texture_dimension_2d;\n        let has_device_pixel_support = check_device_pixel_support();\n        let renderer_config = WgpuSurfaceConfig {\n            size: Size {\n                width: DevicePixels(0),\n                height: DevicePixels(0),\n            },\n            transparent: false,\n            preferred_present_mode: None,\n        };\n        let renderer = WgpuRenderer::new_from_surface(context, surface, renderer_config)?;\n\n        let touch_input = browser_window\n            .match_media(\"(pointer: coarse)\")\n            .ok()\n            .flatten()\n            .is_some_and(|query| query.matches());\n        let ime_mirror = ImeMirror::new(&document, &body, touch_input)?;","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_web/src/window.rs#L143-L179","documentation":"Fired in `Window::new` on the web backend when `input_element.append_child` (or equivalent DOM append of the hidden HTMLInputElement used for keyboard/text input capture) fails, e.g. because the canvas/document body is not attached or the element was already disposed. {e:?} carries the js_sys/DOMException.","triggerScenarios":"Thrown at crates/gpui_web/src/window.rs:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the document body exists and is mounted before creating the window (window.document.body must be Some).","Ensure the input element is created via the same document that hosts the canvas.","Check browser console for the underlying DOMException (HierarchyRequestError, NotFoundError).","Retry window creation after the DOM is fully loaded (wait for the `load`/DOMContentLoaded event)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}