Description
I have a WASI C++ program that when I compile it and try to import it in my html, I get Uncaught (in promise) TypeError: WebAssembly.instantiate(): Import #0 "wasi_snapshot_preview1": module is not an object or function
What could be causing this?
I added -Oz to the clang command line and that fixed it temporarily, but then when I tried to -Wl,--export=mainloop, I got the error back again. Then I narrowed down one specific part of my C++ code that causes the error, but nothing in that section seemed special or out of the ordinary. It did use some variables that were defined with uint32_t and uint8_t, so I tried redefining them as ints, but I still got the error. Then I kept getting the error even when commenting out the stuff that commenting out made the error go away to begin with!