Replies: 4 comments 5 replies
-
If you're facing issues compiling one of
This might be related to this issue.
You can do so by installing llvm clang via homebrew. There are some further instructions in the linked issue's comments. |
Beta Was this translation helpful? Give feedback.
-
If you get an error like this: Compiling getrandom v0.3.1
error: The wasm32-unknown-unknown targets are not supported by default;
you may need to enable the "wasm_js" configuration flag.
Note that enabling the `wasm_js` feature flag alone is insufficient.
For more information see: https://docs.rs/getrandom/#webassembly-support
--> .cargo/registry/src/index.crates.io-6f17d22bba15001f/getrandom-0.3.1/src/backends.rs:159:9
|
159 | / compile_error!(
160 | | "The wasm32-unknown-unknown targets are not supported by default; \
161 | | you may need to enable the \"wasm_js\" configuration flag. Note \
162 | | that enabling the `wasm_js` feature flag alone is insufficient. \
163 | | For more information see: \
164 | | https://docs.rs/getrandom/#webassembly-support"
165 | | );
| |_________^ Then that's due to depending on ( Make sure to read the linked documentation section carefully. getrandom = { version = "0.3", features = ["wasm_js"] } And enable the necessary rustflags when building: $ RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo build --target=wasm32-unknown-unknown # ... etc. Alternatively, you can also set these rust flags in your [target.wasm32-unknown-unknown]
rustflags = ["--cfg", 'getrandom_backend="wasm_js"'] |
Beta Was this translation helpful? Give feedback.
-
If you have an issue building
Then make sure to install 32 bit clang in your environment. I personally got this error on NixOS, and can fix it there by running the build inside a nix shell or installing the $ nix shell nixpkgs#clang_multi
$ cargo build --target=wasm32-unknown-unknown # ... |
Beta Was this translation helpful? Give feedback.
-
Is it possible to use this with crates like dioxus, egui, etc. that target browsers? I spent a few hours trying to set it up, but kept getting errors that this and that are missing in |
Beta Was this translation helpful? Give feedback.
-
Let's use this discussion thread for common issues faced when trying to use
iroh
in an application that's complied totarget=wasm32-unknown-unknown
that are then used in browsers :)If you encounter an issue, look for the existing posts that mention it, or if you can't find a fitting answer, comment with your problem ✌️
Beta Was this translation helpful? Give feedback.
All reactions