Just ran into this, adding what I found if someone wants to dig deeper.
This errors out
getrandom = { version = "0.2.6", features = ["js"]}
rand = "0.8.5"
Error: The Replica returned an error: code 5, message: “Wasm module of canister rrkah-fqaaa-aaaaa-aaaaq-cai is not valid: Wasm module has an invalid import section. Module imports function ‘__wbindgen_describe’ from ‘wbindgen_placeholder’ that is not exported by the runtime.”
This works
getrandom = { version = "0.2.3", features = ["js"]}
rand = "0.7.3"
$ dfx --version
dfx 0.9.3