Skip to content

"Not able to serialize module" error #468

@MentalGear

Description

@MentalGear

Context

I have compiled a WASIX version of busybox, but I (and claude) struggle to get it running in Wasmer (7 alpha 2) due to a serialization error. Maybe you could share your expertise ?

Full Busybox-WASIX Repo & Reproduction
https://github.com/MentalGear/busybox-wasm-wasi/tree/claude/wasix-only-1bTRo#busybox-wasix

--- General Wasmer Issue Report ---

Environment

  • @wasmer/sdk version: 0.10.0 (regression from 0.9.0)
  • Platform: Linux/macOS

Description

When using runWasix() with a local WASM file (WASIX-compiled BusyBox), the SDK fails with:

panicked at src/tasks/task_wasm.rs:38:43:
called `Result::unwrap()` on an `Err` value: Generic("Not able to serialize module")

Followed by:

RuntimeError: unreachable
    at wasmer_js_bg.wasm:0x417b11

Version Comparison

Version Behavior
0.9.0 No panic, but exit code: 1 with no output (args issue?)
0.10.0 Panics with "Not able to serialize module"

Steps to Reproduce

  1. Compile a WASIX module (e.g., BusyBox with wasix-libc)
  2. Serve it with Cross-Origin Isolation headers
  3. Load and run with runWasix():
import { init, runWasix } from '@wasmer/sdk';

await init();

const response = await fetch('./busybox-wasix.wasm');
const wasmBytes = new Uint8Array(await response.arrayBuffer());

const instance = await runWasix(wasmBytes, {
  args: ['busybox', 'echo', 'hello'],
  env: { 'HOME': '/', 'PATH': '/bin' }
});

const result = await instance.wait();  // <-- Error thrown here

Expected Behavior

The WASM module should execute and return output.

Actual Behavior

The SDK panics at src/tasks/task_wasm.rs:38:43 with "Not able to serialize module".

Additional Context

  • Cross-Origin Isolation is enabled (crossOriginIsolated === true)
  • SharedArrayBuffer is available
  • The same WASM file runs correctly with wasmer run CLI (v6.1.0, v7.0+)
  • Wasmer.fromRegistry() examples work (e.g., python/python)
  • The WASM file requires WASIX imports (wasix_32v1.*), not just basic WASI

WASM Module Imports

wasix_32v1.proc_fork
wasix_32v1.fd_pipe
wasix_32v1.chdir
wasix_32v1.getcwd
wasix_32v1.thread_id
... (and wasi_snapshot_preview1.* standard imports)

Misc Console Warnings

using deprecated parameters for the initialization function; pass a single object instead

Questions

  • Is running local WASIX modules supported in the browser SDK?
  • Are there specific module requirements for browser compatibility?
  • Does the SDK only support packages from the Wasmer Registry?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions