diff --git a/src/bin/wasmtime.rs b/src/bin/wasmtime.rs index 07a08b7a43..1801a335c8 100644 --- a/src/bin/wasmtime.rs +++ b/src/bin/wasmtime.rs @@ -316,6 +316,10 @@ fn rmain() -> Result<(), Error> { "wasi_unstable".to_owned(), Instance::from_handle(store.clone(), wasi)?, ); + module_registry.insert( + "wasi_unstable_preview0".to_owned(), + Instance::from_handle(store.clone(), wasi)?, + ); // Load the preload wasm modules. for filename in &args.flag_preload { diff --git a/wasmtime-wasi-c/js-polyfill/polyfill.c b/wasmtime-wasi-c/js-polyfill/polyfill.c index d4c63cebf2..52b56b5b70 100644 --- a/wasmtime-wasi-c/js-polyfill/polyfill.c +++ b/wasmtime-wasi-c/js-polyfill/polyfill.c @@ -22,7 +22,10 @@ void handleFiles(void) { __builtin_trap(); EM_ASM(" \ - const imports = { wasi_unstable: WASIPolyfill }; \ + const imports = {\ + wasi_unstable: WASIPolyfill, \ + wasi_unstable_preview0: WASIPolyfill \ + }; \ let file = document.getElementById('input').files[0]; \ let file_with_mime_type = file.slice(0, file.size, 'application/wasm'); \ let response = new Response(file_with_mime_type); \