gltfjsx icon indicating copy to clipboard operation
gltfjsx copied to clipboard

gltfjsx command error.

Open Jules003 opened this issue 1 year ago • 5 comments

Hello, the following error occurs when I run the npx gtlfjsx model.gltf command in a shell env and I'm a little confused. if anyone could point out what I'm doing wrong that would be amazing.

(node:6616) 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) Parse TypeError: fetch failed at Object.processResponse (node:internal/deps/undici/undici:5555:34) at node:internal/deps/undici/undici:5877:42 at node:internal/process/task_queues:140:7 at AsyncResource.runInAsyncScope (node:async_hooks:203:9) at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Jules003 avatar Jul 21 '22 17:07 Jules003

have the same issue

noti56 avatar Aug 08 '22 07:08 noti56

same issue

rodrigo-mahamud avatar Aug 08 '22 15:08 rodrigo-mahamud

Same issue! Have been stuck here for a couple hours. Help would be appreciated.

LionstoneDevelopment avatar Aug 09 '22 08:08 LionstoneDevelopment

There's a few issues with gltfjsx and node 18, could be worth downgrading node to v16 and seeing if that works

willmadd avatar Aug 11 '22 17:08 willmadd

As willmadd suggested, I downgraded to Node v16 by npm install -g n (the node version manager) sudo npm cache clean -f sudo n 16.16.0 use node -v to check the version (dont forget to go back to your current node version) then it worked!

minhbui27 avatar Aug 16 '22 02:08 minhbui27

Downgrading to Node v16.17.0 did the trick for me.

tjterry avatar Nov 01 '22 01:11 tjterry

Same here, looks like it doesn't work on >16 versions of Node

satvikpendem avatar Nov 26 '22 23:11 satvikpendem

While we wait for the fix for Node v18, instead of downgrading to Node v16..., you can try a fork of a fix,

try, $ npx Sean-Bradley/gltfjsx#fix-dependencies [Model] [options]

instead of $ npx gltfjsx [Model] [options]

Sean-Bradley avatar Dec 13 '22 11:12 Sean-Bradley

merged and published it, sorry for the long delay!

drcmda avatar Dec 21 '22 12:12 drcmda

i might have inadvertedly caused another node 18 issue by using squoosh in v6 🫠 node and that brute forced esm switch is such a mess right now.

npx [email protected] ... will work, but no webp + squoosh (which has drastic size benefits) npx gltfjsx will most likely complain

i talked to don mccurdy and gltf-transform will soon kick out squoosh in favour of sharp, then all these issues should go away.

drcmda avatar Dec 21 '22 18:12 drcmda

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

fatemeRasolzade avatar Apr 28 '23 14:04 fatemeRasolzade