AXUM WASIX STARTER
This repo contains a starter project for building a Wasix based axum web server.
Prerequisites
Install and pin the following versions for local wasmer run and Edge deploy to match:
| Component | Version |
|---|---|
| Wasmer CLI | 7.2.0-alpha.3 or newer stable with equivalent WASIX |
| cargo-wasix | 0.1.26+ (cargo install -f cargo-wasix) |
| wasix-org/rust toolchain | v2025-03-17.2 (see below) |
Application dependencies
| Crate | Version | Notes |
|---|---|---|
axum | 0.6.9 | Pinned: 0.6.10+ needs tokio ^1.25; WASIX fork is wasix-1.24.2 |
tokio | 1.24.2 | Patched via wasix-org/tokio (wasix-1.24.2) |
serde | 1.0.x (lock: 1.0.228) | crates.io; safe to cargo update -p serde |
tracing | 0.1.x (lock: 0.1.44) | crates.io |
tracing-subscriber | 0.3.x (lock: 0.3.23) | crates.io |
Pin the WASIX Rust toolchain
cargo wasix downloads the latest toolchain by default. Newer tags (e.g. v2025-11-07.1+rust-1.90) emit wasix_32v1.ws_connect imports that Wasmer 7.2.x does not implement yet, which breaks local runs.
Use the newest tested tag without those imports:
cargo wasix download-toolchain v2025-03-17.2
Do not run bare cargo wasix download-toolchain unless you intend to move to a newer tag and re-verify with wasmer inspect (no ws_connect / http_request imports).
Install Wasmer 7.2.0-alpha.3 (Linux x86_64 example)
curl -fsSL -o /tmp/wasmer.tar.gz \
https://github.com/wasmerio/wasmer/releases/download/v7.2.0-alpha.3/wasmer-linux-amd64.tar.gz
tar -xzf /tmp/wasmer.tar.gz -C /tmp
cp /tmp/bin/wasmer ~/.wasmer/bin/wasmer
wasmer --version
Compiling the project
cargo wasix build --release
Cargo.lock pins mio to wasix#a4662d9 for wasix crate Errno compatibility. After cargo update, confirm that revision is still present.
cargo wasix may warn that hyper should be patched; this project uses crates.io hyper 0.14.27 with the wasix-1.24.2 tokio fork. Adding a [patch.crates-io] hyper entry causes cargo-wasix to resolve tokio epoll, which breaks the build.
Running the project
PORT=8080 wasmer run target/wasm32-wasmer-wasi/release/whatsapp-webhook.wasm --net
curl http://127.0.0.1:8080/
Note: Set
PORTwhen running locally (e.g.8080). On Wasmer Edge the platform typically expects port 80.
Deploy to Wasmer Edge
- Login to
wasmer-cli:
wasmer login
- Set your namespace in
wasmer.tomlandapp.yaml(ownerfield). - Build and deploy:
cargo wasix build --release
wasmer deploy
app.yaml uses package: . to deploy the local package built from wasmer.toml.
Checkout the full tutorial here and the Wasmer Rust HTTP guide.
Troubleshooting
ws_connectunknown import: WASIX toolchain is too new for your Wasmer CLI. Runcargo wasix download-toolchain v2025-03-17.2and rebuild.wasix::Errno/wasix::wasi::Errnocompile error in mio: ensureCargo.lockhasmioat git reva4662d9669d850bf430192c3e2fbd21e4753cec8.libc = "=0.2.139"resolution failed: keeplibcpinned by rev inCargo.toml(4c0c6c29378b68c4af7f0b1384a111ba3081b6bf); avoidcargo updatewithout--lockedunless you know the graph still resolves.