ceifa / wasmoon

A real lua 5.4 VM with JS bindings made with webassembly
MIT License
462 stars 27 forks source link

Node v18.1.0 fetch failed #50

Closed levno-710 closed 2 years ago

levno-710 commented 2 years ago

When trying to run factory.createEngine() in Node v18.1.0 i get the following Error:

TypeError: fetch failed
    at Object.processResponse (node:internal/deps/undici/undici:5575:34)
    at node:internal/deps/undici/undici:5901:42
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:202:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: unknown scheme
      at makeNetworkError (node:internal/deps/undici/undici:4675:51)
      at schemeFetch (node:internal/deps/undici/undici:5877:18)
      at node:internal/deps/undici/undici:5729:26
      at mainFetch (node:internal/deps/undici/undici:5750:11)
      at fetching (node:internal/deps/undici/undici:5703:7)
      at Agent2.fetch2 (node:internal/deps/undici/undici:5586:20)
      at Object.fetch (node:internal/deps/undici/undici:6372:20)
      at fetch (node:internal/bootstrap/pre_execution:199:25)
      at node_modules\wasmoon\dist\index.js:1222:67
      at node_modules\wasmoon\dist\index.js:1222:288 {
    [cause]: undefined
  }
}

This seems to be caused by invalid glue code

ceifa commented 2 years ago

This happens because emscripten doesn't support node v18 yet. Related: https://github.com/emscripten-core/emscripten/issues/16915 https://github.com/emscripten-core/emscripten/issues/16913

This will probably be fixed very soon. A workaround for now it's pass the --no-experimental-fetch flag to node.

levno-710 commented 2 years ago

Thanks

ceifa commented 2 years ago

Fixed in version 1.13.0