pmndrs / gltfjsx

๐ŸŽฎ Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.86k stars 318 forks source link

error with command npx gltfjsx #149

Open ppacory opened 2 years ago

ppacory commented 2 years ago

After command : npx gltfjsx model.glb

TypeError: Failed to parse URL from /Documents/GIT/threejs/2022/sandbox.15.06.22/node_modules/draco3dgltf/draco_decoder_gltf.wasm
    at new Request (node:internal/deps/undici/undici:4813:19)
    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 /Documents/GIT/threejs/2022/sandbox.15.06.22/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:39:485
    at /Documents/GIT/threejs/2022/sandbox.15.06.22/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:40:128
    at Object.createDecoderModule (/Documents/GIT/threejs/2022/sandbox.15.06.22/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:40:151)
    at Object.<anonymous> (/Documents/GIT/threejs/2022/sandbox.15.06.22/node_modules/gltfjsx/src/bin/DRACOLoader.js:2:40)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)

my npm list :
โ”œโ”€โ”€ @emotion/react@11.9.0 โ”œโ”€โ”€ @emotion/styled@11.8.1 โ”œโ”€โ”€ @fontsource/inter@4.5.11 โ”œโ”€โ”€ @mui/icons-material@5.8.2 โ”œโ”€โ”€ @mui/material@5.8.2 โ”œโ”€โ”€ @mui/system@5.8.2 โ”œโ”€โ”€ @react-three/drei@9.13.0 โ”œโ”€โ”€ @react-three/fiber@8.0.22 โ”œโ”€โ”€ @testing-library/jest-dom@5.16.4 โ”œโ”€โ”€ @testing-library/react@13.3.0 โ”œโ”€โ”€ @testing-library/user-event@13.5.0 โ”œโ”€โ”€ @use-gesture/react@10.2.15 โ”œโ”€โ”€ draco3d@1.5.2 โ”œโ”€โ”€ gltfjsx@4.6.4 โ”œโ”€โ”€ meshline@2.0.4 โ”œโ”€โ”€ randomcolor@0.6.2 โ”œโ”€โ”€ react-color@2.19.3 โ”œโ”€โ”€ react-dom@18.1.0 โ”œโ”€โ”€ react-scripts@5.0.1 โ”œโ”€โ”€ react@18.1.0 โ”œโ”€โ”€ three@0.141.0 โ”œโ”€โ”€ web-vitals@2.1.4 โ””โ”€โ”€ zustand@4.0.0-rc.1

ppacory commented 2 years ago

the problem is here draco CDN. is not found
a look here : https://github.com/google/draco/issues/888 && https://github.com/node-fetch/node-fetch/issues/1566

perhaps try to replace with : https://cdn.jsdelivr.net/npm/draco3d@1.5.2/draco_decoder.wasm

soul-on-you commented 2 years ago

I have the same problem

ppacory commented 2 years ago

i use this to transform to mesh : https://gltf.pmnd.rs/

benjaminha14 commented 2 years ago

same, having the same problem

willmadd commented 2 years ago

Seems that the package is not compatible with node 18, I downgraded to node 16 and it works fine.

superdwayne commented 2 years ago

Saved my sanity thank you @willmadd

drcmda commented 2 years ago

i think nothing at the moment is compatible with node 18, i can't run anything, bundlers, all out of order due to breaking changes in some low level ssl stuff.

matrix-root commented 2 years ago

Thanks! I think, it'll be cool to add notes about Node 16 to README