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

Add '.wasm' to import * as wasm from './<rust-lib-name>_bg.wasm #154

Closed
limira opened this issue Apr 21, 2018 · 2 comments
Closed

Add '.wasm' to import * as wasm from './<rust-lib-name>_bg.wasm #154

limira opened this issue Apr 21, 2018 · 2 comments

Comments

@limira
Copy link
Contributor

limira commented Apr 21, 2018

I tried wasm-bindgen with Parcel.

My though is in file <rust-lib-name>.js should uses: import * as wasm from './<rust-lib-name>_bg.wasm';

Parcel is happy with the extension .wasm and compile the project. But the browser complains:

Error: Cannot find module '8'
TypeError: second argument must be an object

I am not sure these errors are with wasm-bindgen for with parcel!

@limira limira changed the title Add '.wasmimport * as wasm from './<rust-lib-name>_bg.wasm Add '.wasm' to import * as wasm from './<rust-lib-name>_bg.wasm Apr 21, 2018
@alexcrichton
Copy link
Contributor

Thanks for the report! Last I checked with Parcel there's good support for importing functionality from a wasm module but it's left unimplemented if a wasm module imports functionality from the environment. I think until that's fixed Parcel will be incompatible with wasm-bindgen :(

@alexcrichton
Copy link
Contributor

I'm gonna close this for now due to my previous comment, but please let me know if the closing is in error!

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