Skip to content
Latchkey

wasm-tools validate: Validate Modules and Components

wasm-tools validate verifies a wasm core module or a component, with per-proposal feature control.

wasm-tools is the Bytecode Alliance Swiss-army knife for wasm, and understands the component model. Its validator is stricter and more current than WABT for cutting-edge proposals.

What it does

wasm-tools validate parses and validates the input as a core module or a component (it auto-detects). Proposals are on or off per the --features list; unknown or disabled features are reported as errors.

Common usage

Terminal
wasm-tools validate module.wasm
wasm-tools validate --features all component.wasm
wasm-tools validate --features simd,bulk-memory module.wasm
wasm-tools validate -t component.wat

Options

FlagWhat it does
--features <list>Comma list of proposals to enable, or all
-t / --watAccept WAT/WIT text input in addition to binary
--output <file>Write a normalized copy (with some subcommands)

In CI

For component-model artifacts, use wasm-tools rather than WABT; only wasm-tools validates components. Gate every produced component on wasm-tools validate --features all so an invalid component fails before jco or a host tries to load it.

Common errors in CI

"error: ... requires the <name> feature" means add it to --features. "error: expected a valid component but found a module" (or the reverse) means you passed the wrong artifact kind. "func type mismatch" and similar are real validation failures in the binary.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →