Skip to content

WebAssembly support #511

@orhun

Description

@orhun

bson is failing to build for wasm*-unknown-unknown target due to the hard dependency on rand crate defined here:

rand = "0.8"

I'm getting this error while trying to serve a WebAssembly application via trunk:

error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://d
ocs.rs/getrandom/#webassembly-support
   --> /home/orhun/.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");
    | |________________________________________________________________________^

Thanks for your work and I'm hoping to get this fixed!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions