-
Notifications
You must be signed in to change notification settings - Fork 86
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
runWasix fails, "memory import has 1 pages which is smaller than the declared initial of 17" #407
Comments
Hi @vexcat, this is a known limitation and happens because the browser doesn't expose a way for finding out how many pages a You can find the full explanation, code sample, and solution in the docs: Instantiation Failed Due to Memory Import Mismatch. The solution is to give const response = await fetch("/rayon-threads.wasm");
const wasm = await response.arrayBuffer();
const instance = await runWasix(wasm);
... |
Hi, thanks for the response. let wasmReq = await fetch('/rayon-threads.wasm');
let wasmArr = new Uint8Array(await wasmReq.arrayBuffer());
let instance = await runWasix(wasmArr, {}); This does not work either, failing with the same error. Maybe this is a recent regression? |
@vexcat did you solve this? Getting the same problem @Michael-F-Bryan |
Unfortunately, I left Wasmer at the end of January and am no longer working on any Wasmer projects. @syrusakbary should be able to help you, though. |
I ran into the same issue. Building |
Hey @vexcat, @argenisleon we are upgrading the SDK on this PR: #424 Let me know if using wasmer-js from the branch solves things for you |
It looks like I modified something in my cache at some point, which is why it appeared a local build worked for me. I was able to reproduce the issue with a fresh cache, and with the npm rc from yesterday. It looks like the problem is That's called from
If you inspect |
Attempting to run a WASIX program using
runWasix(module, {})
on @wasmer/sdk 0.6.0 fails with ok: false.Using
initializeLogger('trace');
to enable logging reveals the following:Memory import in .wasm file:
Despite this being the only memory import,
MemoryType { minimum: 1 pages, maximum: None, shared: false }
is logged, and wasmer attempts to initialize the module with only 1 page of memory.Code to reproduce:
The text was updated successfully, but these errors were encountered: