dotnet / dotnet-wasi-sdk

An SDK for building .NET projects as standalone WASI-compliant modules
MIT License
279 stars 12 forks source link

How to run web app with wasmer #6

Open sebagomez opened 1 year ago

sebagomez commented 1 year ago

I'm using wasmer and I'm able to run the console application as explained, but I cannot seem to find how to run the web app.

dotnet run throws the following error

An error occurred trying to start process 'wasmtime' with working directory '/Users/eq12350/dev/seba/wasm-dotnet/src/web'. No such file or directory

Where is that wastime coming from? how can I configure wasmer?

Running just wasmer module.was throws the following

❯ wasmer bin/Debug/net7.0/web.wasm                                                                       
error: failed to run `bin/Debug/net7.0/web.wasm`
│   1: failed to instantiate WASI module
╰─▶ 2: Error while importing "wasi_snapshot_preview1"."sock_accept": unknown import. Expected Function(FunctionType { params: [I32, I32, I32], results: [I32] })

Thanks

stassss2011 commented 1 year ago

Hi! I played with it couple weeks ago. I added working web app to this repo for you. It runs correctly with dotnet run. But I had installed wasmtime previously, as Readme says.

Also, currently networking via this sdk supported only in wasmtime runtime. Both wasmer and wasmedge don't work. It's because only wasmtime implemented wasi_snapshot_preview1 WASI standard

sebagomez commented 1 year ago

Ok, good to know, thanks. Will give wasmtime a try... I guess it's wasm-time 😉

Sorry, I had to

msolari1589 commented 1 week ago

Hi! I played with it couple weeks ago. I added working web app to this repo for you. It runs correctly with dotnet run. But I had installed wasmtime previously, as Readme says.

Also, currently networking via this sdk supported only in wasmtime runtime. Both wasmer and wasmedge don't work. It's because only wasmtime implemented wasi_snapshot_preview1 WASI standard

Hello sr! Im triying to do this same thing but with the compile on another docker and i cant make it work, im stuck on this error :

wasm-builder-1 exited with code 0
wasm-app-1      | info: Microsoft.Hosting.Lifetime
wasm-app-1      |       Now listening on: http://localhost:8080
wasm-app-1      | Fatal: TCP accept failed with errno 8. This may mean the host isn't listening for connections. Be sure to pass the --tcplisten parameter.
wasm-app-1 exited with code 1