Summary
At main@c545db2 (module version 0.8.0), the README correctly says that Mocket supports the JS and native backends. However, the package configuration still selects mocket.wasm.mbt and serve.mbt for wasm/wasm-gc, so server code using Mocket::listen type-checks successfully for those targets and then traps at runtime.
Relevant code:
Reproduction
fn main {
@mocket.new().listen("127.0.0.1:49401")
}
With an executable package that declares Wasm support:
moon check <package> --target wasm
# succeeds
moon check <package> --target wasm-gc
# succeeds
moon run <package> --target wasm
# RuntimeError: unreachable
# at @oboard/mocket.listen_ffi
# at @oboard/mocket.Mocket::listen
Expected behavior
Unsupported server targets should be rejected at build/check time rather than exposing public APIs that always panic.
The direct fix is to declare the package's actual backend support at the top level of moon.pkg:
supported_targets = "js+native"
This makes moon check/moon build reject wasm and wasm-gc consumers at the package boundary, matching the README and avoiding runtime-only panic stubs. If a functional Wasm/WASI server backend is implemented later, the target set can be expanded then.
Summary
At
main@c545db2(module version 0.8.0), the README correctly says that Mocket supports the JS and native backends. However, the package configuration still selectsmocket.wasm.mbtandserve.mbtforwasm/wasm-gc, so server code usingMocket::listentype-checks successfully for those targets and then traps at runtime.Relevant code:
moon.pkgselects the Wasm implementationserve_ffiandlisten_ffiare panic stubsReproduction
fn main { @mocket.new().listen("127.0.0.1:49401") }With an executable package that declares Wasm support:
Expected behavior
Unsupported server targets should be rejected at build/check time rather than exposing public APIs that always panic.
The direct fix is to declare the package's actual backend support at the top level of
moon.pkg:This makes
moon check/moon buildrejectwasmandwasm-gcconsumers at the package boundary, matching the README and avoiding runtime-only panic stubs. If a functional Wasm/WASI server backend is implemented later, the target set can be expanded then.