API reference › @evolu/sqlite-wasm › SqliteWasmSource

type SqliteWasmSource =
  WebAssembly.Module | BufferSource | Response | PromiseLike<Response>;

Defined in: packages/sqlite-wasm/src/Wasm.ts:258

The wasm binary, compiled or not.

A Response or a promise of one, such as fetch returns, compiles while it downloads when its Content-Type is exactly application/wasm, which keeps Chromium's code cache too. That is the only type every engine's WebAssembly.compileStreaming accepts, so any other compiles from its bytes once it has downloaded. A failed fetch fails with SqliteWasmCompileError, and so does a response whose status is not ok, such as a 404 for a wrong URL, with a TypeError naming the status as its cause. A WebAssembly.Module suits a module compiled elsewhere. Loading compiles a small generated module, so a Content Security Policy must allow 'wasm-unsafe-eval' even for a precompiled Module.