I built my portfolio site in Rust with Dioxus, and deploying it to Vercel was harder than expected. Here's what I ran into and the open-source CLI I made to fix it.
What goes wrong
- Connect a Dioxus repo as it is and Vercel picks its Rust preset. It builds the web app as a server function, so the build shows Ready but every page returns 500.
- DioxusLabs' prebuilt
dxneeds glibc 2.35. Vercel's build machines have 2.34. - Compiling
dxduring the build works, but each build takes 13 to 17 minutes.
The fix
cargo install dioxus-vercel --lockeddioxus-vercel initgit pushThen import the repo on Vercel. On Vercel, the build downloads a dx built for Vercel's OS (a daily GitHub Action builds one for every Dioxus release) and keeps Rust's build output in node_modules/.cache, which Vercel restores between builds. On a small app: first build about 3 minutes, later builds about 1 minute, previews included. No token needed.
Limitations
- Client-side apps only: no static site generation or server functions yet.
- Bigger apps take longer to compile than my test apps.
Repo: https://github.com/nylla8444/dioxus-vercel
Live demo: https://dioxus-vercel-init-demo.vercel.app
Feedback welcome, especially if you deploy Rust/WASM to Vercel another way.