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

On a m1 mac with wasm-pack@0.12 installed, initializing the wasi module cases error #1346

Open
zhusjfaker opened this issue Nov 19, 2023 · 2 comments

Comments

@zhusjfaker
Copy link

πŸ› Bug description

➜  lib git:(main) wasm-pack --version
wasm-pack 0.12.1
➜  lib git:(main) rustc --version
rustc 1.74.0 (79e9716c9 2023-11-13)

any disk location/ index.mjs


import { WASI } from '@wasmer/wasi';
import { WasmFs } from '@wasmer/wasmfs';
import { argv, env } from 'node:process';
import path from 'node:path';

const wasmFs = new WasmFs();
// // Create a new WASI Instance
const wasi = new WASI({
  args: argv, // Arguments passed to the Wasm Module
  env: env, // Environment variables that are accessible by the Wasm Module
  preopens: {
    '/local': '/Users/zhushijie/Desktop/company/rust-lib-template/packages/nodejs-demo'
  },
});

console.log(wasi);
$: node index.mjs

ABhAAAAcwAAAAkAAABjYXBhY2l0eSBvdmVyZmxvdwAAAIyKEAARAAAAL3J1c3RjLzI1ODViY2VhMGJjMmE5YzQyYTRiZTJjMWViYTVjNjExMzdmMmIxNjcvbGlicmFyeS9hbGxvYy9zcmMvdmVjL3NwZWNfZnJvbV9pdGVyX25lc3RlZC5ycwAAqIoQAF4AAAA7AAAAEgAAAC9ydXN0Yy8yNTg1YmNlYTBiYzJhOWM0MmE0YmUyYzFlYmE1YzYxMTM3ZjJiMTY3L2xpYnJhcnkvYWxsb2Mvc3JjL3ZlYy9tb2QucnMYixAATAAAAE0LAAANAAAAAAAAAAMAAAABAAAAAgAAABASCgsYGAkPBgcYCAMVGBgYGBgYDg0TFhgYGBgYGBgYGBgYDBgUGAUIFB0dAwRADQ4PGx0cNSs/SUEGMzodNhwIFB0dAwRADQ4PGx0cNSwrP0lBBjM3HQAAAAAAkwAgCAAAAADRACAIAAAAANEAIAgAAAAA/////38AQZiYwgALBf////9/AEGgmMIACwEDAEGwmMIACwEBAEHEmMIACwGnAEHUmMIACwGn"))];case 1:g=A.sent(),A.label=2;case 2:Z=t(g),A.label=3;case 3:return[4,Z];case 4:return A.sent(),[2]}}))}))},exports.initSync=function(A){const I=H();return A instanceof WebAssembly.Module||(A=new WebAssembly.Module(A)),q(new WebAssembly.Instance(A,I),A)};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

TypeError: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer')

Node.js v20.9.0

Process finished with exit code 1

πŸ€” Expected Behavior

init wasi is normal

πŸ‘Ÿ Steps to reproduce

node index.mjs

you will get the error msg in your terminal

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.12.1
rustc version: 1.74.0
rustup toolchain: stable

@zhusjfaker
Copy link
Author

I'm just trying to initialize an wasi module, haven't loaded any wasm code in wasi format, and I'm getting an wasm-bindgen error. I'm very surprised.

@zhusjfaker
Copy link
Author

"@wasmer/wasi": "1.2.2",
"@wasmer/wasm-transformer": "0.12.0",
"@wasmer/wasmfs": "0.12.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

1 participant