I am starting out with web-assembly following this guide: https://depth-first.com/articles/2020/06/29/compiling-rust-to-webassembly-a-simple-example/
When I compile the source with cargo build --target wasm32-unknown-unknown --release
i get a .wasm
file. Instead of importing this module in JavaScript, I want to uses wasmer. I have installed wasmer 2.2.1, but when I try to run wasmer run target/wasm32-unknown-unknown/release/hello.wasm
, I get the following error:
error: failed to run `target/wasm32-unknown-unknown/release/hello.wasm`
╰─▶ 1: No export `_start` found in the module.
Similar functions found: `add_one`.
Try with: wasmer target/wasm32-unknown-unknown/release/hello.wasm -i add_one
Is this the intended use of wasmer
? If so, where should I search for culprits?
EDIT
I did not read the error message properly, it seems as if wasmer run target/wasm32-unknown-unknown/release/hello.wasm -i add_one 1
does work and will return 2.