Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo leptos watch not compiling from axum/actix templates #390

Open
matthewharwood opened this issue Nov 5, 2024 · 1 comment
Open

Comments

@matthewharwood
Copy link

Doing tutorial on https://book.leptos.dev/ssr/21_cargo_leptos.html

Tried both actix and axum templates both give same error:

$ sw_vers
     ProductName:		macOS
     ProductVersion:		15.1

$ system_profiler SPHardwareDataType
Hardware:
      Model Name: MacBook Pro
      Chip: Apple M2 Max
$harwood  % rustc --version
       rustc 1.84.0-nightly (fbab78289 2024-11-04)
$ harwood  % cargo install cargo-leptos
    Updating crates.io index
    Ignored package `cargo-leptos v0.2.21` is already installed, use --force to override
$ harwood signup-ssr-axum % cargo leptos new --git leptos-rs/start-axum
     (nightly)
$ harwood signup-ssr-axum % rustup target add wasm32-unknown-unknown
     info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
$ harwood signup-ssr-axum % cargo leptos watch
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling serde v1.0.214
   ....

Error: at `/Users/harwood/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-leptos-0.2.21/src/compile/front.rs:51:30`

Caused by:
    0: at `/Users/harwood/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-leptos-0.2.21/src/compile/front.rs:126:10`
    1:

       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.93
            this binary schema version: 0.2.95

       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.95

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

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

       if this warning fails to go away though and you're not sure what to do feel free
       to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
@gtsiam
Copy link

gtsiam commented Dec 6, 2024

rust Wasm file schema version: 0.2.93

This means that the version of cargo-leptos you have installed has bundled wasm-bindgen 0.2.93

this binary schema version: 0.2.95

And this is the version of wasm-bindgen you have as a dependency in your application and is used to build the wasm binary file.

Solution: Update cargo-leptos (cargo install --force cargo-leptos should do it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants