Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node:wasi fails during module resolution #23531

Open
lucacasonato opened this issue Apr 24, 2024 · 0 comments
Open

node:wasi fails during module resolution #23531

lucacasonato opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lucacasonato
Copy link
Member

So I don't actually care if it's implemented - but right now it is not possible to publish a module using node:wasi to JSR, because Deno rejects the specifier (see jsr-io/jsr#441)

Example that fails during graph building (run deno info on it)`.

import { WASI } from 'node:wasi';
import { readFile } from "node:fs/promises";

const wasi = new WASI({
  version: "preview1",
  args: ["bin_name"],
  preopens: {
	  "/": "/",
	  ".": ".",
  },
  });
  
  (async () => {
    const wasm = await WebAssembly.compile(await readFile("filename.wasm"));
    
    const instance = new WebAssembly.Instance(wasm, {
	    wasi_snapshot_preview1: wasi.wasiImport,
    });
  wasi.start(instance);
})();
@lucacasonato lucacasonato added the bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants