{"record":{"id":"341af7e24b73ca01","repo":"iced-rs/iced","slug":"send-compositor","errorCode":null,"errorMessage":"Send compositor","messagePattern":"Send compositor","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"winit/src/lib.rs","lineNumber":582,"sourceCode":"                            let mut compositor =\n                                <P::Renderer as compositor::Default>::Compositor::new(\n                                    backend_settings,\n                                    display_handle,\n                                    window,\n                                    shell,\n                                )\n                                .await;\n\n                            if let Ok(compositor) = &mut compositor {\n                                for font in default_fonts {\n                                    compositor.load_font(font.clone());\n                                }\n                            }\n\n                            compositor_sender\n                                .send(compositor)\n                                .ok()\n                                .expect(\"Send compositor\");\n\n                            // HACK! Send a proxy event on completion to trigger\n                            // a runtime re-poll\n                            // TODO: Send compositor through proxy (?)\n                            {\n                                let (sender, _receiver) = oneshot::channel();\n\n                                proxy.send_action(Action::Window(\n                                    runtime::window::Action::GetLatest(sender),\n                                ));\n                            }\n                        }\n                    };\n\n                    #[cfg(target_arch = \"wasm32\")]\n                    wasm_bindgen_futures::spawn_local(create_compositor);\n\n                    #[cfg(not(target_arch = \"wasm32\"))]","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/iced-rs/iced/blob/d146509d893945de5c304cfaf4301335eee278bd/winit/src/lib.rs#L564-L600","documentation":"Panic from `.expect(\"Send compositor\")` after sending the compositor creation result through a oneshot channel in run_instance. It fires only when the receiving half (compositor_receiver) has already been dropped, which means the event loop abandoned the await — an internal invariant violation of the wint runtime's compositor handshake.","triggerScenarios":"The create_compositor future completes after the run_instance loop has exited or moved past the compositor_receiver.await (e.g. loop termination raced the async creation on wasm32 via spawn_local, or the receiver was dropped during shutdown).","commonSituations":"wasm32 builds where the spawned compositor task outlives the event loop; abrupt application shutdown while the compositor is still being created; nested runtime shutdown races.","solutions":["Update iced/winit — this handshake race has been fixed in newer versions","Avoid tearing down the application while the first window is still opening","Report with a minimal reproduction if it reproduces deterministically on wasm32"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// wasm32: keep the event loop alive until the first window reports Opened before doing async work","typeGuard":null,"tryCatchPattern":"// panics are not catchable in Rust; upgrade iced and keep the loop alive until first window opens","preventionTips":["Pin to an iced release where the compositor handshake race is fixed","Avoid exiting the app while the first window is still being created","On wasm32, don't spawn competing futures that can drop the event loop"],"tags":["panic","async","wasm","channel"],"backgroundTag":"broken-pipe","analyzedSha":"d146509d893945de5c304cfaf4301335eee278bd","analyzedAt":"2026-09-11T16:54:14.229Z","contentChangedAt":"2026-09-11T16:54:14.229Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}