Patched dioxus-server 0.7.3 for wasm32-unknown-unknown compatibility.
This is a minimal fork of dioxus-server that adds cfg-gating so the crate compiles for Cloudflare Workers (wasm32 target). It is used by dioxus-cloudflare to run Dioxus #[server] functions on the Workers runtime.
Upstream dioxus-server 0.7.3 depends on tokio (full), hyper, tower-http, and other native-only crates that fail to compile on wasm32-unknown-unknown. Cloudflare Workers run single-threaded WASM — they don't need a full async runtime, TCP listeners, or HTTP servers.
This fork applies the minimum changes to make compilation succeed:
- Gate server-only modules behind
#[cfg(not(target_arch = "wasm32"))]inlib.rs - Split
server.rsinto native/wasm submodules — WASM gets a minimalFullstackStatestub - Split
serverfn.rsmake_handler— native usesspawn_pinned(), WASM uses anAssertSendwrapper (safe because wasm32 is single-threaded) - Move heavy deps to
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] - WASM tokio: optional, features =
["rt", "sync", "macros"]only (nonet)
Add this patch to your workspace Cargo.toml:
[patch.crates-io]
dioxus-server = { git = "https://github.com/JaffeSystems/dioxus-server-cf.git" }Then depend on dioxus-server = "=0.7.3" as normal — Cargo resolves it to this fork.
| Area | Upstream | This Fork |
|---|---|---|
| Target | Native only | Native + wasm32 |
| Tokio | Full runtime | Minimal (rt, sync, macros) on wasm32 |
| Hyper/tower-http | Always included | cfg-gated out on wasm32 |
make_handler |
spawn_pinned() |
AssertSend wrapper on wasm32 |
| Server modules | Always compiled | Stubbed on wasm32 |
| API surface | Full | Identical on native; headless-only on wasm32 |
This fork tracks dioxus-server 0.7.3 exactly. When upstream Dioxus releases a new version, this fork will need to be rebased onto the new upstream.
Same as upstream Dioxus — MIT license.
Patches and modifications copyright 2026-2027 Jaffe Systems.