{"record":{"id":"0a47af7eb17061dd","repo":"zed-industries/zed","slug":"no-document-found-on-window","errorCode":null,"errorMessage":"No `document` found on window","messagePattern":"No `document` found on window","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_web/src/window.rs","lineNumber":84,"sourceCode":"    pub(crate) pressed_button: Cell<Option<MouseButton>>,\n    pub(crate) last_physical_size: Cell<(u32, u32)>,\n    pub(crate) notify_scale: Cell<bool>,\n    pub(crate) is_composing: Cell<bool>,\n    /// Set while `show_virtual_keyboard` blur/focus-cycles the hidden input.\n    /// The cycle is a keyboard-visibility hint, not a real activity change;\n    /// letting the focus/blur listeners report it would re-enter GPUI\n    /// synchronously from inside an input dispatch, and a `RefCell`\n    /// double-borrow panic on wasm never unwinds, wedging the app.\n    pub(crate) suppress_focus_status_events: Cell<bool>,\n    /// The visual viewport height when the current pointer gesture began.\n    /// A mid-gesture change means the software keyboard opened or closed and\n    /// reflowed the layout, so the release position no longer refers to what\n    /// the user aimed at.\n    pub(crate) gesture_start_visual_viewport_height: Cell<f64>,\n    /// A touch that may still resolve into a tap: its pointer id and starting\n    /// position, cleared once it travels beyond touch slop. Virtual keyboard\n    /// and IME focus may only change when a touch release completes a tap;\n    /// pans must leave them untouched, or scrolling over editable content\n    /// flickers the keyboard and drags the caret around.\n    pub(crate) touch_tap_candidate: Cell<Option<(i32, Point<Pixels>)>>,\n    mql_handle: RefCell<Option<MqlHandle>>,\n    pending_physical_size: Cell<Option<(u32, u32)>>,\n    raf_id: Cell<Option<i32>>,\n    raf_function: RefCell<Option<js_sys::Function>>,\n}\n\npub struct WebWindow {\n    inner: Rc<WebWindowInner>,\n    display: Rc<dyn PlatformDisplay>,\n    lifecycle: Rc<Cell<WebWindowLifecycle>>,\n    active_window: Rc<RefCell<Option<AnyWindowHandle>>>,\n    _raf_closure: Closure<dyn FnMut()>,\n    _resize_observer: Option<web_sys::ResizeObserver>,\n    _resize_observer_closure: Closure<dyn FnMut(js_sys::Array)>,\n    _safe_area_observer: Option<web_sys::ResizeObserver>,\n    _safe_area_observer_closure: Closure<dyn FnMut(js_sys::Array)>,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_web/src/window.rs#L66-L102","documentation":"Guard in WebWindow::prepare_canvas: window.document() returned None, i.e. the JS global is not a fully initialized browsing context (e.g. worker scope, or DOM not ready). The canvas-preparation path requires a document node to create the drawing surface.","triggerScenarios":"Thrown at crates/gpui_web/src/window.rs:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure GPUI web code runs on the main thread with a DOM (not in a Worker)","Defer initialization until DOMContentLoaded when the document may not exist yet","Fail with this descriptive error before attempting any canvas/DOM operations"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}