无法执行 "trunk serve"

Unable to execute "trunk serve"

我开始接触 Rust 并查看了 Yew 框架(Rust 的前端框架)的这些简单说明。

(发现于:https://yew.rs/docs/tutorial

我一直按照说明进行操作,直到出现命令

trunk serve --open

但是,某处出现故障。

这是我得到的:

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

这是我的 Cargo.toml 文件:

[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"

我运行rustup target list --installed命令后的输出:

aarch64-apple-darwin
wasm32-unknown-unknown

Machine: M1 Mac(带Apple Silicon芯片)

铁锈版本: 1.60.0

t运行k 版本: 0.15.0

任何帮助将不胜感激,因为我刚刚接触 Rust 和 Web Assembly。

谢谢

通过安装 wasm-bindgen-cli 修复它:

cargo install --locked wasm-bindgen-cli

此 PR 在 trunk 的 GitHub 中提到:https://github.com/thedodd/trunk/pull/375