Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Draco compression tries to use the fetch api to load the wasm blob off the filesystem and fails with `ERR_INVALID_URL`

See original GitHub issue

Full error:

(node:4270) 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)
TypeError: Failed to parse URL from /home/ashley/node_modules/draco3d/draco_encoder.wasm
    at new Request (node:internal/deps/undici/undici:4816:19)
    at Agent2.fetch2 (node:internal/deps/undici/undici:5544:29)
    ... 10 lines matching cause stack trace ...
    at Object.tryCatcher (/home/ashley/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ashley/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/ashley/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/ashley/node_modules/bluebird/js/release/promise.js:649:10) {
  [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:4814:25)
      at Agent2.fetch2 (node:internal/deps/undici/undici:5544:29)
      at Object.fetch (node:internal/deps/undici/undici:6372:20)
      at fetch (node:internal/bootstrap/pre_execution:199:25)
      at /home/ashley/node_modules/draco3d/draco_encoder_nodejs.js:36:498
      at /home/ashley/node_modules/draco3d/draco_encoder_nodejs.js:37:214
      at Object.createEncoderModule (/home/ashley/node_modules/draco3d/draco_encoder_nodejs.js:37:237)
      at compressDracoMeshes (/home/ashley/node_modules/gltf-pipeline/lib/compressDracoMeshes.js:54:52)
      at /home/ashley/node_modules/gltf-pipeline/lib/processGltf.js:67:12
      at tryCatcher (/home/ashley/node_modules/bluebird/js/release/util.js:16:23)
      at Object.gotValue (/home/ashley/node_modules/bluebird/js/release/reduce.js:166:18)
      at Object.gotAccum (/home/ashley/node_modules/bluebird/js/release/reduce.js:155:25)
      at Object.tryCatcher (/home/ashley/node_modules/bluebird/js/release/util.js:16:23) {
    input: '/home/ashley/node_modules/draco3d/draco_encoder.wasm',
    code: 'ERR_INVALID_URL'

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

danvascommented, May 13, 2022

Seems to only happen in Node 18. Node 16 works fine. I tested draco 1.5.2 for both.

Assuming this problem isn’t caused by gltf-pipeline in some way, could you submit to bug report to the draco repo?


expensescommented, May 12, 2022

No, I didn’t look very hard into this. An easy workaround seems like it should be possible though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pointcloud not loading - CesiumJS - Cesium Community
I have a pointcloud on Cesium Ion which renders in the Sandcastle but does not render in my app. The browser returns a...
Read more >
fetch api cannot load, url scheme 'file' is not supported
Since your URL is relative (it's just "hi.txt" ), it's resolved against the URL of the page the code is running in.
Read more >
DracoCompression can not work inside web worker thread
In any case, in your PG, I think the reason why Draco doesn't work is because the Draco scripts aren't loaded in the...
Read more >
Draco WebAssembly updates break Webpack 4 build
After upgrading Cesium from v1.43 to v1.45, pulling in the glTF Draco compression support, my Webpack build is failing regarding WebAssembly.
Read more >
WASM memory access out of bounds using DracoLoader on ...
Hi, I'm currently running into an issue where I'm trying to load a Draco compressed model using the Draco Loader on mobile browsers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found