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

Wasm - Cannot find module env #72

Closed
fredfortier opened this issue Jun 17, 2021 · 2 comments
Closed

Wasm - Cannot find module env #72

fredfortier opened this issue Jun 17, 2021 · 2 comments

Comments

@fredfortier
Copy link

This crate is triggering the behavior documented here: rust-bitcoin/rust-secp256k1#254, here: rustwasm/wasm-bindgen#2160 and here: rustwasm/wasm-pack#743

Please let me know if you think the root cause is similar and can patch quickly.

@fredfortier
Copy link
Author

I tried manually replacing require('env') with require('crypto'), which I assume is what it wants.

let imports = {};
imports['__wbindgen_placeholder__'] = module.exports;
imports['env'] = require('crypto');

It does not work, but it might offer an additional clue:

$ node ./build/index.js
/src/rust-packages/ddx-wasm/examples/node_modules/ddx-wasm/ddx_wasm.js:173
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
                     ^

LinkError: WebAssembly.Instance(): Import #1 module="env" function="GFp_aes_nohw_encrypt" error: function import requires a callable

@MatthewHerbst
Copy link

@fredfortier did you end up solving this issue? I'm running into something very similar but can't seem to figure out why it's including the env import. Thanks

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

2 participants