question-mark
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.

run: npx gltfjsx model.gltf

See original GitHub issue

Before asking I like to do some research but I have a question that I can’t solve, according to the pmndrs/gltfjsx github documentation info:

A typical use-case
First you run your model through gltfjsx. npx allows you to use npm packages without installing them.

I run the command **npx gltfjsx shoe.gltf** and it gives me the following error:

(node:12892) 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.fetch (node:internal/deps/undici/undici:11118:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Thanks in advance for the help.

Attach: image

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
burnhamcommented, Dec 15, 2022

Solution and is working for me:

`When using GLTFJSX, you may get the error,

TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11118:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

At the time of writing this warning, the latest LTS version of Node.js and GLTFJSX are incompatible.

Only if you get this error, you can execute a version of GLTFJSX that contains the fix.

For example, instead of running,

npx gltfjsx ./public/models/shoe-draco.glb

run this,

npx ggozad/gltfjsx#fix-dependencies ./public/models/shoe-draco.glb

Remember to only try this if you are experiencing the problem. The actual fix to GLTFJSX should be merged soon.

Another option is to unistall your version of NodeJS and install the specific NodeJS 16.18 LTS instead.

Install packages for your operating system can be found at https://nodejs.org/download/release/v16.18.1/`

Source: https://sbcode.net/react-three-fiber/gltfjsx/

In case you need some help, just contact me.

1reaction
Sean-Bradleycommented, Dec 21, 2022

Thanks for restoring. I thought it was too late and gone forever.

Yours works as expected.

$ npx ggozad/gltfjsx#fix-dependencies .\public\shoe-draco.glb
(node:2096) 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)
group removed (empty)
group removed (empty)                                                                                                                                               
 Done:  Shoe-draco.js

and my experience of the latest GLTFJSX 6.0.1

npx gltfjsx .\public\shoe-draco.glb
(node:11952) 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: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11118:11)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Running npx gltfjsx Model.gltf fails with Error: Invalid hook call.
When running npx gltfjsx Model.gltf against any gltf model it fails. It returns this Error. ERROR Objects are not valid as a React...
Read more >
gltfjsx - npm
First you run your model through gltfjsx. npx allows you to use npm packages without installing them. npx gltfjsx model.gltf --transform.
Read more >
Gltfjsx NPM
First you run your model through gltfjsx. npx allows you to use npm packages without installing them. npx gltfjsx model.gltf.
Read more >
GLTFJSX - React Three Fiber Tutorials - sbcode.net
Description. GLTFJSX is a command line tool that will read through a glTF model, and extract its components into a JSX equivalent.
Read more >
Working with GLTF models in React.js - YouTube
Import GLTF model into React.js to build a product customizer with react-three-fiber. GLTF files can be exported from blender.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found