yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications
https://yew.rs
Apache License 2.0
30.23k stars 1.41k forks source link

I am unable to build even the simplest Yew applications using Rust 1.76 and running under macOS 14.3 #3620

Closed carlca closed 4 months ago

carlca commented 4 months ago

Problem I am unable to build even the simplest Yew applications using Rust 1.76 and running under macOS 14.3

Steps To Reproduce Run cargo install trunk. Run rustup target add wasm32-unknown-unknown Goto any Yew app folder and run trunk serve.

I have tried the YT video at https://discord.com/channels/701068342760570933/1213256829195522148/1213256829195522148 as well as Yew's own sample app, described on https://discord.com/channels/701068342760570933/1213256829195522148/1213256829195522148 Moreover, I have git cloned the entire Yew repo and cannot build and run any of the example apps>

Expected behavior I expect to be able to open my browser to 1287.0.0.1:8080 and run any of the apps.

Screenshots This is an example of the errors which occur...

[Fri Mar 01 2024 10:06pm (GMT+0000)]  is πŸ“¦ v0.1.0  via πŸ¦€ v1.76.0
~/Code/Rust/rust_front_end
trunk serve
2024-03-01T22:06:38.144221Z  INFO πŸš€ Starting trunk 0.18.8
2024-03-01T22:06:38.151646Z  INFO πŸ“¦ starting build
2024-03-01T22:06:38.152767Z  INFO spawning asset pipelines
2024-03-01T22:06:38.562443Z  INFO copying & hashing css path="style.css"
2024-03-01T22:06:38.562626Z  INFO building rust_front_end
2024-03-01T22:06:38.562959Z  INFO finished copying & hashing css path="style.css"
   Compiling proc-macro2 v1.0.78
   Compiling unicode-ident v1.0.12
   Compiling once_cell v1.19.0
   Compiling wasm-bindgen-shared v0.2.91
   Compiling log v0.4.21
   Compiling bumpalo v3.15.3
   Compiling wasm-bindgen v0.2.91
   Compiling cfg-if v1.0.0
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-unknown-unknown` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-unknown-unknown`
error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
2024-03-01T22:06:39.079748Z ERROR :x: error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: error during cargo build execution
    3: cargo call to executable 'cargo' with args: '["build", "--target=wasm32-unknown-unknown", "--manifest-path", "/Users/carlcaulkett/Code/Rust/rust_front_end/Cargo.toml"]' returned a bad status: exit status: 101
2024-03-01T22:06:39.346780Z  INFO :satellite: serving static assets at -> /
2024-03-01T22:06:39.346792Z  INFO :satellite: server listening at http://127.0.0.1:8080

Note that despite trunk telling me that server listening at http://127.0.0.1:8080, when I open the address in Arc, I get a 404. I also have the same results in Safari and Firefox.

Environment:

Questionnaire

carlca commented 4 months ago

Problem solved πŸ˜ƒ I had previously installed Rust 1.75.0 via home brew and then forgotten about it.

More recently I had installed Rust 1.76.0 via the official curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh command, but it effectively meant I had two copies of cargo floating around.

It hadn't caused my dealings with Rust any undue effects, to my knowledge at least, except where WASM was concerned.

I ran brew uninstall rust and rustup self uninstall followed by curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh again, then rustup target add wasm32-unknown-unknown and cargo install trunk. Everything works now πŸ˜ƒ