I am trying to load sql-wasm.wasm from https://github.com/sql-js/sql.js such that it does not need a server. Otherwise, trying to load wasm from HTML gives CORS error. I converted it to base64 (~800KB) which looks like this
const SQLBASE64 = "AGFzbQEAAAABrQRHYAJ/fwF/YAF/AX....AAJ4BAEHwogQLA4AWUQ==";
(link to full base64 string)
WebAssembly.Instance
only works with very small binaries. WebAssembly.instantiate()
and WebAssembly.instantiateStreaming()
both end up with errors about incorrect object, format, or headers etc.
How do I do it properly?