Undefined GLTF object react-three-fiber

Hello! I’m getting started with needle using react-three-fiber, and am getting this console error on the webpage:

TypeError: Cannot read properties of undefined (reading 'indexOf')
    at createBuiltinComponents (engine_gltf_builtin_components.ts:52:26)
    at NeedleGltfLoader.createBuiltinComponents (engine_scenetools.ts:20:16)
    at handleLoadedGltf (engine_scenetools.ts:91:23)
    at engine_scenetools.ts:148:23
    at GLTFLoader.js:221:6
    at GLTFLoader.js:2974:5

I’ve tried using both the ‘Minimal (Needle)’ starter scene and the ‘Sandbox (Needle)’ starter scene, and both of them result in this error. I assume it means it cannot identify a GLTF model to render, but I’m not sure why since I haven’t adjusted the starter scenes provided by needle, and the scene game object does have that GLTF Object script on it.

Any ideas how to get past this error?

Original Post on Discord

by user 690021744479830061

I’d also be okay with exporting separate GLTF objects instead of one scene object – whichever makes more sense in this context

by user 690021744479830061

Hi @keren thanks for reporting. Will take a look at what is happening there

Fixed the issue, will publish a new version with it in a little bit

Hello @keren when you update to the latest version you can re-generate your project (or add the react-three-fiber npmdef in the ExportInfo dependencies array) and it should work then

Amazing, thanks so much, I’ll try it out!

by user 690021744479830061

It’s working now, tysm!! :pray:

by user 690021744479830061