Open
Description
Deno removed wasi from their standard library, we should use the wasi polyfill instead on Deno 2.
From https://discord.com/channels/1011124058408112148/1156304630028959824/1295444183930110013:
main.ts
import createPlugin from "npm:@extism/extism";
const plugin = await createPlugin(
"plugin.wasm",
{ useWasi: true, runInWorker: true },
);
let out = await plugin.call("greet", "a1");
console.log(out?.text());
lib.rs
(compiled to wasm32-wasi w/ release)
use extism_pdk::*;
#[plugin_fn]
pub fn greet(name: String) -> FnResult<String> {
Ok(format!("Hello, {}!", name))
}
result:
Uncaught (in worker "") Relative import path "wasi" not prefixed with / or ./ or ../ and not in import map from "data:text/javascript;base64,dm...lots of base64...
hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:wasi").
at data:text/javascript;base64,dm...
Metadata
Metadata
Assignees
Labels
No labels