emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

emcc hello.c -o hello.js error in nodejs v18.20.2

Open Zibri opened this issue 1 year ago • 2 comments

Node: v18.20.2
$ emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.5 ()
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

node test2.js
/home/runner/test2.js:146
      throw ex;
      ^

TypeError: Failed to parse URL from /home/runner/test2.wasm
    at node:internal/deps/undici/undici:12618:11 {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:405:5)
      at new URL (node:internal/url:676:13)
      at new Request (node:internal/deps/undici/undici:6108:25)
      at fetch (node:internal/deps/undici/undici:10396:25)
      at Object.fetch (node:internal/deps/undici/undici:12617:10)
      at fetch (node:internal/process/pre_execution:281:25)
      at instantiateAsync (/home/runner/test2.js:1710:14)
      at createWasm (/home/runner/test2.js:1746:3)
      at Object.<anonymous> (/home/runner/test2.js:1949:11)
      at Module._compile (node:internal/modules/cjs/loader:1364:14) {
    input: '/home/runner/test2.wasm',
    code: 'ERR_INVALID_URL'
  }
}

Zibri avatar May 07 '24 14:05 Zibri

That error message is not familiar to me, but 3.1.5 is over two years old, so I would test with a new version, as there might have been a bug that was fixed here.

If that doesn't fix it, please attach a full testcase we can reproduce with.

kripken avatar May 07 '24 20:05 kripken

A full set of link flags at least would be very useful in diagnosing.

sbc100 avatar May 07 '24 21:05 sbc100