yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications

Home Page:https://yew.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed To Build Tutorial

cjsmocjsmo opened this issue · comments

Problem
The tutorial https://yew.rs/docs/tutorial fails to build.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to https://yew.rs/docs/tutorial
  2. Follow the instruction per that page

Expected behavior
Expected "Hello World" to appear on the screen.

Environment:

  • Yew version: 0.20
  • Rust version: rustc 1.68.2 (9eb3afe9e 2023-03-27)
  • Target, wasm32-unknown-unknown
  • Build tool: trunk
  • OS: Ubuntu 22.10 (arm64, raspberry pi)
  • Browser and version: vivaldi 5.7.2921.65 (Stable channel) stable (64-bit)

trunk serve --open
2023-04-14T09:51:38.356982Z INFO 📦 starting build
2023-04-14T09:51:38.358353Z INFO spawning asset pipelines
2023-04-14T09:51:38.752600Z INFO building yew-app
Finished dev [unoptimized + debuginfo] target(s) in 0.27s
2023-04-14T09:51:39.178263Z INFO fetching cargo artifacts
2023-04-14T09:51:39.613110Z INFO processing WASM for yew-app
2023-04-14T09:51:39.706576Z INFO calling wasm-bindgen for yew-app
2023-04-14T09:51:39.716807Z ERROR ❌ error
error from HTML pipeline

Caused by:
0: error from asset pipeline
1: error spawning wasm-bindgen call
2: Exec format error (os error 8)
2023-04-14T09:51:39.717993Z INFO 📡 serving static assets at -> /
2023-04-14T09:51:39.718203Z INFO 📡 server listening at http://127.0.0.1:8080

This is likely due to you are using a linux arm64 platform.

Trunk cannot download tools for linux arm64 yet.

Trunk needs the following tools:

  1. wasm-bindgen-cli (can be installed via cargo install wasm-bindgen-cli).
  2. wasm-opt (can be obtained here)
  3. sass (can be obtained here)

2 and 3 are optional and you can disable them.

This is an issue with trunk about downloading toolchain.

If you face any other issues regarding using the trunk command, please file it with trunk.

Thanks! That did the trick. I went ahead and opened a bug on trunk to have these bits added. Might be a good idea to update the documentation to reflect this issue on am64.