cryptool-org / wasm-webterm

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

WasmWebTerm is not a constructor #2

Open ChrisJefferson opened 1 year ago

ChrisJefferson commented 1 year ago

I tried copying the following line from the readme, into my HTML, to pick where binaries are read from:

let wasmterm = new WasmWebTerm("./binaries")

But, I get the output:

Uncaught TypeError: WasmWebTerm is not a constructor
    <anonymous> http://localhost:8080/wasm-webterm.html:16
[wasm-webterm.html:16:28](http://localhost:8080/wasm-webterm.html)
    <anonymous> http://localhost:8080/wasm-webterm.html:16

I'm not a javascript expert, so sorry if this is obvious.

z11labs commented 1 year ago

Hi and thank you for trying wasm-webterm :)

Did you load it via script tag or import it as a module? If you loaded it via a script tag directly in your browser (like in Variant 1 of the Usage section in the Readme), it may work to add .default to it:

let wasmterm = new WasmWebTerm.default("./binaries")

Did this work for you? :D