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

Error on Node.js 18 #5

Open
NoelJacob opened this issue May 19, 2022 · 4 comments
Open

Error on Node.js 18 #5

NoelJacob opened this issue May 19, 2022 · 4 comments

Comments

@NoelJacob
Copy link

NoelJacob commented May 19, 2022

(node:15366) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

node:internal/event_target:908
  process.nextTick(() => { throw err; });
                           ^
TypeError [Error]: Failed to parse URL from /home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vm-exec.wasm
    at new Request (node:internal/deps/undici/undici:4813:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:5539:29)
    ... 4 lines matching cause stack trace ...
    at /home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vm-exec.js:9:38689
    at getInstance (/home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vmExec.js:16:22)
    at vm_exec (/home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vmExec.js:22:28)
    at runTVM (/home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/executor/executor.js:58:39)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:289:10)
    at [kOnMessage] (node:internal/worker:300:37)
    at MessagePort.<anonymous> (node:internal/worker:201:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:639:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:377:5)
      at URL.onParseError (node:internal/url:563:9)
      at new URL (node:internal/url:643:5)
      at new Request (node:internal/deps/undici/undici:4811:25)
      at Agent.fetch2 (node:internal/deps/undici/undici:5539:29)
      at Object.fetch (node:internal/deps/undici/undici:6370:20)
      at fetch (node:internal/bootstrap/pre_execution:196:25)
      at instantiateAsync (/home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vm-exec.js:9:10542)
      at createWasm (/home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vm-exec.js:9:11152)
      at /home/noel/Desktop/conex/node_modules/.pnpm/[email protected][email protected]/node_modules/ton-contract-executor/dist/vm-exec/vm-exec.js:9:38689
}

Node.js v18.2.0

I ran the examples and this is the result. My system is arch linux.

@NoelJacob
Copy link
Author

This is an bug emscripten-core/emscripten#16913, caused by Node adding WebAssembly.instantiateStreaming in version 18. I'm sure either emscripten or node will come up with a real solution to this at some point (there's a PR emscripten-core/emscripten#16917), but in the mean time you can work around this by invoking node with --no-experimental-fetch.

@NoelJacob NoelJacob changed the title Error on linux Error on Node.js 18 May 23, 2022
@arterialist
Copy link

I have encountered exact same issue on Node v18.7.0. Downdrading to v16.18.0 solves the issue.

@manylov
Copy link

manylov commented Apr 28, 2023

It is very frustrating, at least it would be great if some error message will be added for users who want to compile it on node 18.
Is it possible to fix somehow?

@NoelJacob
Copy link
Author

@manylov @arterialist do node --no-experimental-fetch script.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants