zed-industries/zed · error
waitAsync result missing 'value'
Error message
waitAsync result missing 'value'
What it means
Indicates the JS Atomics.waitAsync call succeeded but the returned result object lacked the expected 'value' property (the waiter promise or value). This means the JS API contract was violated — the runtime returned an object without 'value', so the dispatcher cannot extract the promise to await. Fires only in non-standard/browser-buggy environments where waitAsync returns a malformed result.
Source
Thrown at crates/gpui_web/src/dispatcher.rs:134
Ok(result) => result,
Err(error) => {
log::error!("Atomics.waitAsync failed: {error:?}");
break;
}
};
let is_async = js_sys::Reflect::get(&result, &JsValue::from_str("async"))
.ok()
.and_then(|v| v.as_bool())
.unwrap_or(false);
// `async: false` means the signal changed between the store and
// the wait ("not-equal"): work has already arrived, so skip
// waiting and drain immediately.
if is_async {
let promise: js_sys::Promise =
js_sys::Reflect::get(&result, &JsValue::from_str("value"))
.expect("waitAsync result missing 'value'")
.unchecked_into();
let _ = wasm_bindgen_futures::JsFuture::from(promise).await;
}
mailbox.drain(&window);
}
});
}
}
pub struct WebDispatcher {
main_thread_id: std::thread::ThreadId,
background_sender: PriorityQueueSender<RunnableVariant>,
main_thread_mailbox: Arc<MainThreadMailbox>,
supports_threads: bool,
#[cfg(feature = "multithreaded")]
_background_threads: Vec<wasm_thread::JoinHandle<()>>,View on GitHub (pinned to f4178619ac)
Solutions
- Check the JS runtime's Atomics.waitAsync implementation (e.g., browser/Firefox version) and target one implementing the spec completely
- Reflect over the result object to log its actual keys and confirm which property is missing
- Fall back to Atomics.wait or a setTimeout-based polling loop when the 'value' field is absent
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/gpui_web/src/dispatcher.rs:134 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/cd6ca648600884a5.
Report an issue: GitHub.