Closed HyperCodec closed 4 months ago
Are you patching some dependency ? Are you sure your cargo cache is unmodified ?
This error you're showing looks like web-sys is missing a feature, I can "reproduce" the same error message by commenting out the ClipboardEvent
feature from web-sys in bevy_egui.
maybe a cargo tree -i web-sys
could help figuring thing out 🤔
Are you patching some dependency ? Are you sure your cargo cache is unmodified ?
This error you're showing looks like web-sys is missing a feature, I can "reproduce" the same error message by commenting out the
ClipboardEvent
feature from web-sys in bevy_egui.![]()
maybe a
cargo tree -i web-sys
could help figuring thing out 🤔
I do not have any patches, what I provided is the entire Cargo.toml
(excluding the top part with package name, author, etc). I ran after a cargo clean
and it continues to have the same error. I'll try the tree command whenever I'm able to get back.
The crate now requires RUSTFLAGS=--cfg=web_sys_unstable_apis
when compiling for WASM with clipboard support. I'll add this to the readme.
Alternatively, you can also add these two lines to your project's .cargo/config.toml
: https://github.com/mvlabat/bevy_egui/blob/18a53882945fa87263566a570da2468314c45ccc/.cargo/config.toml#L5-L6
The crate now requires
RUSTFLAGS=--cfg=web_sys_unstable_apis
when compiling for WASM with clipboard support. I'll add this to the readme.Alternatively, you can also add these two lines to your project's
.cargo/config.toml
:
This compiles, but now I get a bunch of improperly formatted WASM binary that errors when I try to bindgen:
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: }}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: ~: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
}}}}}}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: ~~: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 2: }: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: ~: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: }}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: }: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 2:}}
}}: not found
~~~: not foundunknown-unknown/debug/creatept.wasm: 1:
target/wasm32-unknown-unknown/debug/creatept.wasm: 2: }}}}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: }: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1:: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: }: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: asm��~}}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 2: ~~: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 4: : not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1:~: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 5: }}}}}}: not found
target/wasm32-unknown-unknown/debug/creatept.wasm: 1: Syntax error: end of file unexpected
I am unsure whether this is an issue with egui or just some weird bug with the compiler.
Could you try compiling bevy_egui
without the unstable apis flag and with the following set of features? This will probably help to isolate whether it's a clipboard-related issue.
bevy_egui = { version = "0.26", default-features = false, features = ["open_url", "default_fonts", "render"] }
I tried those features, they didn't appear to change anything. I updated wasm-bindgen
and the error changed to this:
error:
it looks like the Rust project used to create this wasm file was linked against
version of wasm-bindgen that uses a different bindgen format than this binary:
rust wasm file schema version: 0.2.91
this binary schema version: 0.2.92
Currently the bindgen format is unstable enough that these two schema versions
must exactly match. You can accomplish this by either updating this binary or
the wasm-bindgen dependency in the Rust project.
You should be able to update the wasm-bindgen dependency with:
cargo update -p wasm-bindgen --precise 0.2.92
don't forget to recompile your wasm file! Alternatively, you can update the
binary with:
cargo install -f wasm-bindgen-cli --version 0.2.91
if this warning fails to go away though and you're not sure what to do feel free
to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
even after making the changes suggested in the error and recompiling, it still gives me the same error.
Which one of the suggested commands have you run? I'd expect this to be fixed if you run either of those (but not both). If it doesn't help, maybe check that you don't have multiple versions of wasm-bindgen
in your tree.
Which one of the suggested commands have you run? I'd expect this to be fixed if you run either of those (but not both). If it doesn't help, maybe check that you don't have multiple versions of
wasm-bindgen
in your tree.
I updated the version in Cargo.lock for wasm-bindgen, now it starts to load and then panics on some random wgpu pipeline in hanabi
Opened https://github.com/mvlabat/bevy_egui/pull/270 to help users learn and fix it :)
The compilation errors are more user friendly now. Thanks everyone
I'm not sure how this is happening or how this is reproducible, but I have the following in my Cargo.toml:
Compiling with
cargo build --target wasm32-unknown-unknown
produces the following errors:This is happening in a GitHub Codespace on Rust 1.76.0