cBournhonesque / lightyear

A networking library to make multiplayer games for the Bevy game engine
https://cbournhonesque.github.io/lightyear/book
Apache License 2.0
483 stars 48 forks source link

Error running the simple_box example via trunk for WASM #611

Open qtfkwk opened 2 months ago

qtfkwk commented 2 months ago
$ git log -n 1 --pretty=format:"%h" --no-show-signature
09ab02f6
$ trunk serve
2024-08-28T13:21:50.131755Z  INFO 🚀 Starting trunk 0.20.3
2024-08-28T13:21:50.134149Z  INFO 📦 starting build
   Compiling bevy_picking_raycast v0.20.0
   Compiling bevy_egui v0.28.0
warning: unused import: `LOCAL_SOCKET`
  --> lightyear/src/client/io/config.rs:21:50
   |
21 | use crate::transport::{BoxedReceiver, Transport, LOCAL_SOCKET};
   |                                                  ^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: `lightyear` (lib) generated 1 warning (run `cargo fix --lib -p lightyear` to apply 1 suggestion)
   Compiling bevy_mod_picking v0.20.1
error[E0308]: mismatched types
   --> /home/qtfkwk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_egui-0.28.0/src/web_clipboard.rs:233:13
    |
233 |         let Some(clipboard) = nav.clipboard() else {
    |             ^^^^^^^^^^^^^^^   --------------- this expression has type `Clipboard`
    |             |
    |             expected `Clipboard`, found `Option<_>`
    |
    = note: expected struct `Clipboard`
                 found enum `std::option::Option<_>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `bevy_egui` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
2024-08-28T13:21:53.585820Z ERROR ❌ error
error from build pipeline

Caused by:
    0: HTML build pipeline failed (1 errors), showing first
    1: error from asset pipeline
    2: running cargo build
    3: error during cargo build execution
    4: cargo call to executable 'cargo' with args: '["build", "--target=wasm32-unknown-unknown", "--manifest-path", "/home/qtfkwk/github.com/cBournhonesque/lightyear/examples/simple_box/Cargo.toml"]' returned a bad status: exit status: 101
...

Seems to be known already in this upstream issue and resolved in 0.29.

Unsure if/how lightyear and/or the simple_box example should be updated?

cBournhonesque commented 2 months ago

Thanks, I think it can be fixed by specifying bevy-inspector-egui="=0.25.1" in the Cargo.toml (the 0.25.2 version seems to be importing egui 0.28 which has the bug you mentioned above)