0

I am trying to compile my substrate node but it is giving me the issue regarding js features:

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/ganesholi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/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");
      | |________________________________________________________________________^

  error[E0433]: failed to resolve: use of undeclared crate or module imp
     --> /Users/ganesholi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/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

I am aware of this issue from here but after implementing the suggestions still I can't fix the issue.

my github repo

1 Answer 1

0

This is the common issue

-> Missing wasm target

Solution: rustup target add wasm32-unknown-unknown

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.