cryptool-org / wasm-webterm

xterm.js addon to run WebAssembly binaries (supports WASI + Emscripten)
https://legacy.cryptool.org/webterm
56 stars 11 forks source link

example with bubbletea apps support #16

Open 7flash opened 1 week ago

7flash commented 1 week ago

https://github.com/charmbracelet/bubbletea/issues/1231

7flash commented 3 days ago

I compiled my golang/bubbletea app to .wasm using https://github.com/BigJk/bubbletea-in-wasm

But when I copied bubbletea.wasm to examples and tried to execute it in web term, it shows an error:

[ERROR] Error: Can't detect a WASI namespace for the WebAssembly Module

tryone144 commented 2 days ago

The linked example compiles to a WebAssembly binary with a custom (Go-specific) JavaScript runtime. We currently don't support loading Go binaries with the JS runtime; only Emscripten is supported right now.

You may have more luck by targeting WASI, which we support with the wasmer runtime. For compiling Go to a WASI compatible binary see https://go.dev/wiki/WebAssembly#wasi-gooswasip1-port.