Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not build to WASM target #158

Open
ipconfiger opened this issue Dec 21, 2024 · 0 comments
Open

Can not build to WASM target #158

ipconfiger opened this issue Dec 21, 2024 · 0 comments

Comments

@ipconfiger
Copy link

╰─$ cargo build --target wasm32-unknown-unknown --release
    Updating `rsproxy` index
remote: Counting objects: 4936, done.
remote: Compressing objects: 100% (2854/2854), done.
remote: Total 4936 (delta 3617), reused 2991 (delta 2002)
Receiving objects: 100% (4936/4936), 1.05 MiB | 5.05 MiB/s, done.
Resolving deltas: 100% (3617/3617), completed with 938 local objects.
From https://rsproxy.cn/crates.io-index
 + fb6e4f5f40...8d012a4b65            -> origin/HEAD  (forced update)
     Locking 68 packages to latest compatible versions
      Adding autocfg v0.1.8 (latest: v1.4.0)
      Adding base64 v0.13.1 (latest: v0.22.1)
      Adding bitflags v1.3.2 (latest: v2.6.0)
      Adding block-buffer v0.9.0 (latest: v0.10.4)
      Adding cloudabi v0.0.3 (latest: v0.1.0)
      Adding crypto-mac v0.8.0 (latest: v0.11.1)
      Adding digest v0.9.0 (latest: v0.10.7)
      Adding generic-array v0.14.7 (latest: v1.1.1)
      Adding hex-literal v0.3.4 (latest: v0.4.1)
      Adding hmac v0.8.1 (latest: v0.12.1)
      Adding rand v0.6.5 (latest: v0.8.5)
      Adding rand_chacha v0.1.1 (latest: v0.3.1)
      Adding rand_core v0.3.1 (latest: v0.6.4)
      Adding rand_core v0.4.2 (latest: v0.6.4)
      Adding rand_hc v0.1.0 (latest: v0.3.2)
      Adding rand_isaac v0.1.1 (latest: v0.3.0)
      Adding rand_jitter v0.1.4 (latest: v0.4.0)
      Adding rand_os v0.1.3 (latest: v0.2.2)
      Adding rand_pcg v0.1.2 (latest: v0.3.1)
      Adding rand_xorshift v0.1.1 (latest: v0.3.0)
      Adding rdrand v0.4.0 (latest: v0.8.3)
      Adding secp256k1 v0.20.3 (latest: v0.30.0)
      Adding secp256k1-sys v0.4.2 (latest: v0.10.1)
      Adding sha2 v0.9.9 (latest: v0.10.8)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.3+wasi-0.2.2)
      Adding zerocopy v0.7.35 (latest: v0.8.13)
      Adding zerocopy-derive v0.7.35 (latest: v0.8.13)
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling crunchy v0.2.2
   Compiling cfg-if v1.0.0
   Compiling subtle v2.6.1
   Compiling byteorder v1.5.0
   Compiling serde v1.0.216
   Compiling getrandom v0.2.15
error: 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/alex/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/getrandom-0.2.15/src/lib.rs:342:9
    |
342 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
343 | |                         default, you may need to enable the \"js\" feature. \
344 | |                         For more information see: \
345 | |                         https://docs.rs/getrandom/#webassembly-support");
    | |________________________________________________________________________^

   Compiling opaque-debug v0.3.1
   Compiling arrayref v0.3.9
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
   --> /Users/alex/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/getrandom-0.2.15/src/lib.rs:398:9
    |
398 |         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
warning: build failed, waiting for other jobs to finish...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant