I'm not sure if this is something particular to my setup but I was running into:
panicked at 'from_entropy failed: Web API self.crypto is unavailable', /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.6.2/src/lib.rs:381:13
when using a module created via wasm-pack build --target nodejs ...
Based on my experimentation, it appears
|
// If `self` is defined then we're in a browser somehow (main window |
global/global.self can exist in a nodejs environment so it follows the browser branch instead of the nodejs branch. I haven't set up a minimal reproduction but verified that
delete global.self in my nodejs entry point resolved my issue. Thoughts?
I'm not sure if this is something particular to my setup but I was running into:
panicked at 'from_entropy failed: Web API self.crypto is unavailable', /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.6.2/src/lib.rs:381:13when using a module created via
wasm-pack build --target nodejs ...Based on my experimentation, it appears
getrandom/src/js.rs
Line 61 in 2471686
delete global.selfin my nodejs entry point resolved my issue. Thoughts?