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

Error running mandelbrot.wasm using nodejs #120

Open
louisvangeldrop opened this issue Dec 20, 2023 · 5 comments
Open

Error running mandelbrot.wasm using nodejs #120

louisvangeldrop opened this issue Dec 20, 2023 · 5 comments

Comments

@louisvangeldrop
Copy link

Under Windows:

  • cd wasmnizer-ts\build

  • node .\cli\ts2wasm.js ..\tests\benchmark\mandelbrot.ts -o mandelbrot.wasm --opt=3 => success

  • cd tools\validate\run_module_on_node

  • node --experimental-wasm-gc --experimental-wasm-stringref --experimental-wasm-modules --experimental-repl-await run_module.js -f main ......\build\mandelbrot.wasm

Error:
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

[CompileError: WebAssembly.instantiate(): invalid value type 0x78 @+12]

Node.js v20.10.0

@kylo5aby
Copy link
Contributor

Hi @louisvangeldrop , thanks for your report, recently V8 have updated GC opcodes, https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit#heading=h.9dwoku9340md, now it use 0x78 to represent i8, but node uses old V8 version now without the newest update, so it will report error, Your can use latest V8 or WAMR to run it.

@louisvangeldrop
Copy link
Author

Which node version supports the right V8?

@xujuntwt95329
Copy link
Contributor

Hi, the latest WasmGC opcode requires V8 version v11.9+, but unfortunately, the latest node release (v21.5.0) is using V8 11.8.172.17, so currently no nodejs release support the latest WasmGC opcodes, we need to wait for the future node release, or reset to previous commit of Wasmnizer-ts

> Note: Wasmnizer-ts follows the latest WasmGC spec, which requires `V8 v11.9+`, but the latest nodejs (v21.5.0) is using `V8 11.8.172.17`, so currently the generated WASM module can't execute on any nodejs releases.
> If you do want to try on nodejs, you can reset to commit `94cf9929421d47a9976fa6edf74b25ef2a00ee12` to build the compiler, which is compatible to older V8 versions.

@louisvangeldrop
Copy link
Author

Nodejs version 22.0.0 is out with V8 version 12.4.254.14-node.10. Also WAMR 2.0.0 is out. So I better wait with some tests until the WAMR 2.0.0 has been integrated into this wasmnizer-ts project.

@xujuntwt95329
Copy link
Contributor

Hi, Thanks for the information. We've already target the WAMR reference to latest version, so current CI is already based on WAMR 2.0.0

For the latest node release, it's exciting to know that 22.0 uses V8 v12, we'll test Wasmnizer-ts on node-22.0.0

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

3 participants