DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.37k stars 747 forks source link

Pin wasm-bindgen in both CLI and web #2083

Closed A-linna closed 3 months ago

A-linna commented 3 months ago

I just learned dioxus this my cargo.toml config

[dependencies]
dioxus = { version = "0.4.3" }
dioxus-web = "0.4.3"

when i execute dx serve

thread 'main' panicked at C:\Users\YHTUCV\.cargo\registry\src\index.crates.io-6f17d22bba15001f\dioxus-cli-0.4.3\src\builder.rs:128:14: calledResult::unwrap()on anErr` value:

it looks like the Rust project used to create this wasm file was linked against version of wasm-bindgen that uses a different bindgen format than this binary:

rust wasm file schema version: 0.2.92 this binary schema version: 0.2.91

Currently the bindgen format is unstable enough that these two schema versions must exactly match. You can accomplish this by either updating this binary or the wasm-bindgen dependency in the Rust project.

You should be able to update the wasm-bindgen dependency with:

cargo update -p wasm-bindgen --precise 0.2.91

don't forget to recompile your wasm file! Alternatively, you can update the binary with:

cargo install -f wasm-bindgen-cli --version 0.2.92

`

I executed cargo update -p wasm-bindgen --precise 0.2.91 and error was still displayed, and then executed cargo install -f wasm-bindgen-cli --version 0.2.92 and the result was still the same. What should I do?

jkelleyrtp commented 3 months ago

It looks like wasm-bindgen yanked one of their versions you need to manually pin wasm-bindgen until we lock down both versions.

Add this line to your cargo.toml:

wasm-bindgen = “=0.2.90”

This should solve the issue, but I'm going to leave this issue up until we pin both versions in the cli and web to the same .92 release.

A-linna commented 3 months ago

It looks like wasm-bindgen yanked one of their versions you need to manually pin wasm-bindgen until we lock down both versions.

Add this line to your cargo.toml:

wasm-bindgen = “=0.2.90”

This should solve the issue, but I'm going to leave this issue up until we pin both versions in the cli and web to the same .92 release.

I executed cargo install dioxus-cli hint Ignored package dioxus-cli v0.4.3 is already installed, use --force to override Then I execute cargo install dioxus-cli --force and it works normally.