Skip to content

Report unresolved browser WebAssembly host imports through wavec run #453

Closed

Description

@LunaStev

Problem

Running a browser-oriented WebAssembly module through wavec run can expose a raw Node.js instantiation error when the module imports host functions.

For example, examples/wasm_module.wave imports env.host_add. Running it for wasm32-unknown-unknown currently ends with a message similar to:

LinkError: WebAssembly.instantiate(): Import #0 module="env" function="host_add": function import requires a callable

The built-in runner cannot invent application-specific browser host functions, but it should explain the contract cleanly.

Scope

  • Inspect WebAssembly imports before instantiation, or normalize the runtime instantiation failure.
  • Report the missing module/function names through a stable wavec diagnostic.
  • Explain that modules with custom browser host imports require an explicit JavaScript host runner.
  • Preserve successful wavec run behavior for modules that need no custom imports.
  • Add a regression based on the existing browser-hosted example.

Acceptance criteria

  • No raw Node.js stack or unclassified LinkError is shown for missing host imports.
  • The diagnostic names env.host_add and provides an actionable next step.
  • Standalone WebAssembly execution remains covered.

Activity

  1. added
    bug
    good first issue
    needs testing
    on Sep 3, 2026
  2. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions