DioxusLabs/dioxus · error

Lazy initialization is only supported with tokio and threads

Error message

Lazy initialization is only supported with tokio and threads enabled.

What it means

Error "Lazy initialization is only supported with tokio and threads enabled." thrown in DioxusLabs/dioxus.

Source

Thrown at packages/fullstack/src/lazy.rs:165

    {
        let ptr: F = unsafe { std::mem::zeroed() };
        let fut = ptr();
        return std::thread::spawn(move || {
            tokio::runtime::Builder::new_current_thread()
                .enable_all()
                .build()
                .unwrap()
                .block_on(fut)
                .map_err(|e| e.into())
        })
        .join()
        .unwrap();
    }

    // todo: technically we can support constructors in wasm with the same tricks inventory uses with `__wasm_call_ctors`
    // the host would need to decide when to cal the ctors and when to block them.
    #[cfg(not(feature = "server"))]
    unimplemented!("Lazy initialization is only supported with tokio and threads enabled.")
}

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/fullstack/src/lazy.rs:165 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/a844414b38e6cd39. Report an issue: GitHub.