zed-industries/zed · error

Created element is not an input: {e:?}

Error message

Created element is not an input: {e:?}

What it means

Guard in WebWindow::new: the created element failed dyn_into::<HtmlInputElement>, so the node intended as the hidden text-input proxy is not an <input>. Indicates createElement tampering or an unusual DOM environment.

Source

Thrown at crates/gpui_web/src/window.rs:152

        }

        let body = document
            .body()
            .ok_or_else(|| anyhow::anyhow!("No `body` found on document"))?;
        body.append_child(&canvas)
            .map_err(|error| anyhow::anyhow!("Failed to append canvas to body: {error:?}"))?;
        Ok(canvas)
    }

    #[allow(clippy::too_many_arguments)]
    pub(crate) fn new(
        _handle: AnyWindowHandle,
        _params: WindowParams,
        context: &WgpuContext,
        canvas: web_sys::HtmlCanvasElement,
        surface: wgpu::Surface<'static>,
        browser_window: web_sys::Window,
        lifecycle: Rc<Cell<WebWindowLifecycle>>,
        active_window: Rc<RefCell<Option<AnyWindowHandle>>>,
    ) -> anyhow::Result<Self> {
        let document = browser_window
            .document()
            .ok_or_else(|| anyhow::anyhow!("No `document` found on window"))?;
        let body = document
            .body()
            .ok_or_else(|| anyhow::anyhow!("No `body` found on document"))?;
        let dpr = browser_window.device_pixel_ratio() as f32;
        let max_texture_dimension = context.device.limits().max_texture_dimension_2d;
        let has_device_pixel_support = check_device_pixel_support();
        let renderer_config = WgpuSurfaceConfig {
            size: Size {
                width: DevicePixels(0),
                height: DevicePixels(0),
            },
            transparent: false,
            preferred_present_mode: None,

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Log the actual tagName/constructor of the returned element to diagnose interference
  2. Avoid libraries that patch document.createElement in the host page
  3. Treat as an unsupported environment and fail window creation with the cast error
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/gpui_web/src/window.rs:145 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/c2e922497e1dd62e. Report an issue: GitHub.