TypeError while using gltfjsx to an animated model: Cannot read properties of null (reading 'array')

Hello, I am struggling to an error while using the gltfjsx command-line tool to turn an animated model into a TSX component.
My model is rigged using the rigify addon in blender like the following:
Capture d'écran 2024-05-29 155126
Capture d'écran 2024-05-29 155157
Then I exported my model to the glTF 2.0 format.

When I check it first to the gltf viewer and it render correctly with the skeleton and the animation.


So I try to use the gltfjsx command-line tool to implement into my code but I got this error as a result:

prune: Removed types… Accessor (16)
prune: Removed types… Material (10)
prune: Removed types… Accessor (158)
instance: Instancing is not currently supported for animated models.
prune: No unused properties found.
prune: No unused properties found.
prune: No unused properties found.
TypeError: Cannot read properties of null (reading ‘array’)
at file:///C:/Users/billy/AppData/Local/npm-cache/_npx/16b3f312213fced0/node_modules/gltfjsx/src/bin/GLTFLoader.js:2425:40
at async Promise.all (index 0)
at async Promise.all (index 1)

I don’t know what I did wrong in my model maybe using rigify for my model is not the best option to export it on the web. :thinking:
Any help would be greatly appreciated.
Thank you in advance. :grinning:

It might be necessary to file a bug and attach the model as a ZIP at GitHub - pmndrs/gltfjsx: 🎮 Turns GLTFs into JSX components, I don’t think I can guess from the messages and screenshots sorry.

1 Like

yes, that’s a bug. we are using a very old version of GLTFLoader in order to make it run under node. it may have fallen behind. a gltf/glb would help to fix it.

Hello, I reported the issue at the github repositery: https://github.com/pmndrs/gltfjsx/issues/262

i get a 404

Ok I fixed it, I created the issue in an alt account with temporary email because I got a 2FA issue with my main account.
I solved it so I reopen the issue with my main account this time: TypeError while using gltfjsx to an animated model: Cannot read properties of null (reading 'array') · Issue #263 · pmndrs/gltfjsx · GitHub
Hope it work for you. :slightly_smiling_face:

i added a fix though i don’t know why it crashed, gltf-data outputAccessor was null whatever that meant. your model though seems very flawed, it’s a few simple shapes but comes in at over 50mb. even gltfjsx/gltf-transform couldn’t help it. when you model in blender towards the web you have to watch out for vertex count, make surfaces as simple as possible. a model on the web shouldn’t be over 2-3mb. your model in particular, as simple as it is, should be 10kb.