Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

"trunk serve" fails for a simple Rust + Yew app

I was getting into Rust and looking at these simple instructions for Yew framework (a frontend framework for Rust).

(Found at: https://yew.rs/docs/tutorial)

I followed the instructions up until the command

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

trunk serve --open

However, something somewhere fails.

This is what I’m getting:

2022-05-06T19:07:54.087214Z  INFO 📦 starting build
2022-05-06T19:07:54.087870Z  INFO spawning asset pipelines
2022-05-06T19:07:54.168329Z  INFO building yew-app
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
2022-05-06T19:07:54.232154Z  INFO fetching cargo artifacts
2022-05-06T19:07:54.295124Z  INFO processing WASM for yew-app
2022-05-06T19:07:54.301974Z  INFO downloading wasm-bindgen version="0.2.80"
2022-05-06T19:07:54.302269Z ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: failed downloading release archive
    2: unsupported architecture
2022-05-06T19:07:54.302531Z  INFO 📡 serving static assets at -> /
2022-05-06T19:07:54.302591Z  INFO 📡 server listening at http://127.0.0.1:8080

This is my Cargo.toml file:

[package]
name = "yew-app"
version = "0.1.0"
edition = "2021"

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

[dependencies]
yew = "0.19"

Output after I run rustup target list --installed command:

aarch64-apple-darwin
wasm32-unknown-unknown

Machine: M1 Mac (with Apple Silicon chip)

Rust version: 1.60.0

trunk version: 0.15.0

Any help would be appreciated as I’m just getting into Rust and Web Assembly.

Thanks

>Solution :

Fix it by installing wasm-bindgen-cli:

cargo install --locked wasm-bindgen-cli

This is mentioned in this PR on trunk’s GitHub: https://github.com/thedodd/trunk/pull/375

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading