From 305a51fe51f5110dc7fef94b9e1c2f95e0219811 Mon Sep 17 00:00:00 2001 From: Nicolas Lepage <19571875+nlepage@users.noreply.github.com> Date: Fri, 22 Jan 2021 00:19:05 +0100 Subject: [PATCH] :alembic: --- sw.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sw.js b/sw.js index 6b437b5..c2e1927 100644 --- a/sw.js +++ b/sw.js @@ -28,7 +28,9 @@ function registerWasmHTTPListener(wasm, base, args = []) { go.env = { WASMHTTP_HANDLER_ID: handlerId, WASMHTTP_PATH: path } go.argv = [wasm, ...args] // FIXME await ? catch ? - WebAssembly.instantiate(wasmPromise, go.importObject).then(({ instance }) => go.run(instance)) + wasmPromise + .then(wasm => WebAssembly.instantiate(wasm, go.importObject)) + .then(({ instance }) => go.run(instance)) e.respondWith(handlerPromise.then(handler => handler(e.request))) })