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

WebAssembly Reference Types not functional #187

Closed
Tarnadas opened this issue Jan 22, 2021 · 2 comments
Closed

WebAssembly Reference Types not functional #187

Tarnadas opened this issue Jan 22, 2021 · 2 comments

Comments

@Tarnadas
Copy link

  • Version: 15.4.0
  • Platform: Microsoft Windows [Version 10.0.19041.630]
  • Subsystem: Debian GNU/Linux 10 (buster) - 10.7

Related ticket in the wasm-bindgen repository:
rustwasm/wasm-bindgen#2274

With the latest Nodejs release and also with other Nodejs versions with updated v8 releases from these branches:
https://github.com/targos/node/tree/v8-88
https://github.com/targos/node/tree/v8-87-v15.x
I get an error when trying to run my Rust application compiled to WebAssembly with reference types enabled like this:

❯ node --experimental-wasm-reftypes .

const wasmModule = new WebAssembly.Module(bytes);
                   ^

CompileError: WebAssembly.Module(): Compiling function #99:"__externref_table_alloc" failed: local.tee[0] expected type i32, found ref.null of type externref @+39165

I think this error is related to the modified version of v8 that Nodejs is using, because I can load my WebAssembly module in latest Chrome with v8 8.7.

@targos
Copy link
Member

targos commented Feb 20, 2021

Node.js does very few modifications to V8. I think it's more likely that this experimental API requires build option to be enabled or some compiler flag.

@Tarnadas
Copy link
Author

It seems like the issue came from wasm-bindgen and it is now fixed.

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