iced-rs/iced · error

Wait for compositor

Error message

Wait for compositor

What it means

Panic from `compositor_receiver.await.expect("Wait for compositor")` in run_instance. The oneshot sender is moved into the create_compositor future, so a None result means that future was dropped before sending — e.g. the spawned local task was cancelled — an internal invariant violation.

Source

Thrown at winit/src/lib.rs:603

                            // 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"))]
                    runtime.block_on(create_compositor);

                    match compositor_receiver.await.expect("Wait for compositor") {
                        Ok(new_compositor) => {
                            compositor = Some(new_compositor);
                        }
                        Err(error) => {
                            let _ = control_sender.start_send(Control::Crash(error.into()));
                            continue;
                        }
                    }
                }

                let window_theme = window
                    .theme()
                    .map(conversion::theme_mode)
                    .unwrap_or_default();

                if system_theme != window_theme {
                    system_theme = window_theme;

View on GitHub (pinned to d146509d89)

Solutions

  1. Update iced/winit to a version with a robust compositor handshake
  2. Ensure Compositor::new does not panic (check GPU/driver support, backend settings)
  3. Test on the target platform; on wasm32 keep the event loop alive until the first window opens
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the GPU backend works before launching: test Compositor::new in a smoke test on the target platform

Try / catch

// Rust panics are not catchable; validate backend/GPU support before running the app

Prevention

When it happens

Trigger: The create_compositor future is dropped before calling sender.send (spawn_local task cancelled on wasm32, or runtime.block_on future aborted), leaving compositor_receiver to yield None.

Common situations: wasm32 event loop shutdown cancelling the spawned task; panics inside Compositor::new propagating as task cancellation; runtime teardown during first-window creation.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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