Warning
This post was published 43 days ago. The information described in this article may have changed.
Hi
I am trying to get lox-wasm running to contribute to the Tor Project.
I followed the README.md and executed wasm-pack build --target web
but I get the following errors:
rror: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
--> /Users/niel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/getrandom-0.2.16/src/lib.rs:346:9
|
346 | / compile_error!("the wasm*-unknown-unknown targets are not supported by \
347 | | default, you may need to enable the \"js\" feature. \
348 | | For more information see: \
349 | | https://docs.rs/getrandom/#webassembly-support");
| |________________________________________________________________________^
Compiling wasm-bindgen v0.2.100
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /Users/niel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/getrandom-0.2.16/src/lib.rs:402:9
|
402 | imp::getrandom_inner(dest)?;
| ^^^ use of undeclared crate or module `imp`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom` (lib) due to 2 previous errors
But wasm_js
is set for get_random
in the Cargo.toml.
It compiles with cargo build --lib --release
but that of course does not generate the correct WASM files IG.
My rustc
version:
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: aarch64-apple-darwin
release: 1.83.0
LLVM version: 19.1.1
What am I missing?
Edit: Also weird, the Cargo.toml specifies v0.3.0 for get_random
, but the error output seems to be working with v0.2.16
├── getrandom v0.3.3
│ │ │ │ │ └── getrandom v0.2.16
5 posts - 2 participants
🏷️ rust_feed