After some time I managed to get a C# library running with the interop strategy from the Wasi.AspNetCore.Server.CustomHost.
However, now an error occurs when loading the WebAssembly file in a browser:
TypeError: WebAssembly.instantiate(): Import #1 module="wasi_snapshot_preview1" error: module is not an object or function w
The STANDALONE_WASM flag instructs the compiler to build your module for WASI (the WebAssembly System Interface, which assumes you are not running in a browser, and interfaces with the underlying OS) - see v8.dev/blog/emscripten-standalone-wasm and bytecodealliance.org/articles/announcing-the-bytecode-alliance. If you remove the flag, your module should be compiled under the assumption it's going to get instantiated in a JavaScript runtime (browser, or Node.js).
Is there a way to get the WebAssembly file to run in the browser environment as well? My imported functions seem to show up in the WebAssembly file after I've inspected it.
After some time I managed to get a C# library running with the interop strategy from the Wasi.AspNetCore.Server.CustomHost. However, now an error occurs when loading the WebAssembly file in a browser:
TypeError: WebAssembly.instantiate(): Import #1 module="wasi_snapshot_preview1" error: module is not an object or function w
After a quick google search I came across this link: https://stackoverflow.com/questions/67756028/why-are-there-wasi-snapshot-preview-1-imports-in-this-wasm-module with the note:
Is there a way to get the WebAssembly file to run in the browser environment as well? My imported functions seem to show up in the WebAssembly file after I've inspected it.