iced-rs/iced · error

Send compositor

Error message

Send compositor

What it means

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.

Source

Thrown at winit/src/lib.rs:582

                            let mut compositor =
                                <P::Renderer as compositor::Default>::Compositor::new(
                                    backend_settings,
                                    display_handle,
                                    window,
                                    shell,
                                )
                                .await;

                            if let Ok(compositor) = &mut compositor {
                                for font in default_fonts {
                                    compositor.load_font(font.clone());
                                }
                            }

                            compositor_sender
                                .send(compositor)
                                .ok()
                                .expect("Send compositor");

                            // HACK! Send a proxy event on completion to trigger
                            // a runtime re-poll
                            // TODO: Send compositor through proxy (?)
                            {
                                let (sender, _receiver) = oneshot::channel();

                                proxy.send_action(Action::Window(
                                    runtime::window::Action::GetLatest(sender),
                                ));
                            }
                        }
                    };

                    #[cfg(target_arch = "wasm32")]
                    wasm_bindgen_futures::spawn_local(create_compositor);

                    #[cfg(not(target_arch = "wasm32"))]

View on GitHub (pinned to d146509d89)

Solutions

  1. Update iced/winit — this handshake race has been fixed in newer versions
  2. Avoid tearing down the application while the first window is still opening
  3. Report with a minimal reproduction if it reproduces deterministically on wasm32
Defensive patterns

Strategy: try-catch

Validate before calling

// wasm32: keep the event loop alive until the first window reports Opened before doing async work

Try / catch

// panics are not catchable in Rust; upgrade iced and keep the loop alive until first window opens

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of iced-rs/iced@d146509d89 (2026-09-11). Data as JSON: /api/errors/341af7e24b73ca01. Report an issue: GitHub.