emilk/egui · error

failed to spawn thread

Error message

failed to spawn thread

What it means

Error "failed to spawn thread" thrown in emilk/egui.

Source

Thrown at crates/egui_extras/src/loaders/file_loader.rs:136

                            let mut cache = cache.lock();
                            if let std::collections::hash_map::Entry::Occupied(mut entry) = cache.entry(uri.clone()) {
                                let entry = entry.get_mut();
                                *entry = Poll::Ready(result);
                                log::trace!("Finished loading {uri:?}");
                                true
                            } else {
                                log::trace!("Canceled loading {uri:?}\nNote: This can happen if `forget_image` is called while the image is still loading.");
                                false
                            }
                        };
                        // We may not lock Context while the cache lock is held (see ImageLoader::load
                        // for details).
                        if repaint {
                            ctx.request_repaint();
                        }
                    }
                })
                .expect("failed to spawn thread");

            Ok(BytesPoll::Pending { size: None })
        }
    }

    fn forget(&self, uri: &str) {
        let _ = self.cache.lock().remove(uri);
    }

    fn forget_all(&self) {
        self.cache.lock().clear();
    }

    fn byte_size(&self) -> usize {
        self.cache
            .lock()
            .values()
            .map(|entry| match entry {

View on GitHub (pinned to d802a982ce)

When it happens

Trigger: Thrown at crates/egui_extras/src/loaders/file_loader.rs:136 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of emilk/egui@d802a982ce (2026-08-16). Data as JSON: /api/errors/ec6a8d1ca2d597bd. Report an issue: GitHub.