{"record":{"id":"ac9a8edffc477586","repo":"zed-industries/zed","slug":"failed-to-initialize-windows-platform","errorCode":null,"errorMessage":"failed to initialize Windows platform","messagePattern":"failed to initialize Windows platform","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_platform/src/gpui_platform.rs","lineNumber":67,"sourceCode":"/// Call this before running the application in a wasm_bindgen entrypoint.\n#[cfg(target_family = \"wasm\")]\npub fn web_init() {\n    console_error_panic_hook::set_once();\n    gpui_web::init_logging();\n}\n\n/// Returns the default [`Platform`] for the current OS.\npub fn current_platform(headless: bool) -> Rc<dyn Platform> {\n    #[cfg(target_os = \"macos\")]\n    {\n        Rc::new(gpui_macos::MacPlatform::new(headless))\n    }\n\n    #[cfg(target_os = \"windows\")]\n    {\n        Rc::new(\n            gpui_windows::WindowsPlatform::new(headless)\n                .expect(\"failed to initialize Windows platform\"),\n        )\n    }\n\n    #[cfg(any(target_os = \"linux\", target_os = \"freebsd\"))]\n    {\n        gpui_linux::current_platform(headless)\n    }\n\n    #[cfg(target_family = \"wasm\")]\n    {\n        let _ = headless;\n        Rc::new(gpui_web::WebPlatform::new(true))\n    }\n}\n\n/// Returns a new [`HeadlessRenderer`] for the current platform, if available.\n#[cfg(feature = \"test-support\")]\npub fn current_headless_renderer() -> Option<Box<dyn gpui::PlatformHeadlessRenderer>> {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_platform/src/gpui_platform.rs#L49-L85","documentation":"current_platform constructs the OS backend; on Windows, WindowsPlatform::new failure (window class registration, DirectWrite/D3D initialization, etc.) is unwrapped since the app cannot run without a platform. The expect surfaces the backend's initialization error at startup.","triggerScenarios":"Thrown at crates/gpui_platform/src/gpui_platform.rs:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the inner WindowsPlatform error log for the failing subsystem (D3D device, DirectWrite, window class)","Verify GPU drivers and DirectX runtime are installed and current","Run on a supported Windows version with a working desktop session"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}