kovacsv / occt-import-js

The emscripten interface for OpenCascade import functionalities.
GNU Lesser General Public License v2.1
141 stars 23 forks source link

TypeError: Failed to parse URL from occt-import-js.wasm #10

Closed trusktr closed 1 year ago

trusktr commented 1 year ago

Hello! I just tried the basic example in the README, and it ends with an error:

❯ node step-to-three.cjs                                                                                                                                                   ✹ ✭
(node:57884) 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)
/Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.js:9
....

TypeError: Failed to parse URL from /Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.wasm
    at new Request (node:internal/deps/undici/undici:5491:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:6288:25)
    ... 4 lines matching cause stack trace ...
    at /Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.js:9:116855
    at Object.<anonymous> (/Users/trusktr/src/Hakkei-Co+meteor-app/step-to-three.cjs:2:47)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:393:5)
      at URL.onParseError (node:internal/url:564:9)
      at new URL (node:internal/url:644:5)
      at new Request (node:internal/deps/undici/undici:5489:25)
      at Agent.fetch2 (node:internal/deps/undici/undici:6288:25)
      at Object.fetch (node:internal/deps/undici/undici:7125:20)
      at fetch (node:internal/process/pre_execution:214:25)
      at instantiateAsync (/Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.js:9:12578)
      at createWasm (/Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.js:9:13188)
      at /Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.js:9:116855 {
    input: '/Users/trusktr/src/Hakkei-Co+meteor-app/node_modules/occt-import-js/dist/occt-import-js.wasm',
    code: 'ERR_INVALID_URL'
  }
}

Node.js v18.8.0

Do I need to run it a certain way?

trusktr commented 1 year ago

I downgraded from Node 18 to Node 17 as hinted over at https://github.com/GoogleChromeLabs/squoosh/issues/1260 and the issue went away.