0

I've decided to give Dioxus another shot.

This time, I tried launching a recently created Dioxus app, and got the following error:

[WARN] Config file: `Dioxus.toml` not found; using default config.
[WARN] Config file: `Dioxus.toml` not found; using default config.
[INFO]  Running build command...
[INFO]  Build done.
[WARN] failed to parse `name` custom section Invalid name type (at offset 30985979)
thread 'main' panicked at 'unknown descriptor: 72', C:\Users\asili\.cargo\registry\src\github.com-1ecc6299db9ec823\wasm-bindgen-cli-support-0.2.83\src\descriptor.rs:154:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ERROR]  Serve startup failed: Build Failed: Bindgen build failed! 
This is probably due to the Bindgen version, dioxus-cli using `0.2.81` Bindgen crate.

Here's my Cargo.toml

[package]
name = "dioxus-example"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dioxus = "0.3.2"
dioxus-web = "0.3.2"
wasm-bindgen = "0.2.78"

main.rs

#![allow(non_snake_case)]
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
use dioxus::prelude::*;

fn main() {
    // launch the web app
    dioxus_web::launch(App);
}

// create a component that renders a div with the text "Hello, world!"
fn App(cx: Scope) -> Element {
    cx.render(rsx! {
        div {
            "Hello, world!"
        }
    })
}

Do you have any ideas on how to solve it?

Jose A
  • 10,053
  • 11
  • 75
  • 108

1 Answers1

1

Updating the dioxus cli worked for me:

cargo install dioxus-cli --force
Neotenic Primate
  • 313
  • 3
  • 13