cli
cli copied to clipboard
Some errors are not reported
Some errors are not reported when using dioxus serve. Instead the compilation just lags forever. This seems to be more common when a crate is not compatable with wasm like in the following example:
[package]
name = "dioxus-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dioxus = "*"
dioxus-web = "*"
tokio = { version = "*", features = ["full"] }
use dioxus::prelude::*;
fn app(cx: Scope) -> Element {
let mut count = use_state(&cx, || 0);
cx.render(rsx!(
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
))
}
fn main(){
dioxus_web::launch(app)
}