Object doesn't load

Hi, i;m using json model with objectloader to load model in three.js. but it’s always getting error like this. I’m trying to fix with this. But still error. What should i do?

`Uncaught TypeError: Cannot read property ‘center’ of undefined
at Ea.copy (three.min.js:381)
at ld.intersectsObject (three.min.js:389)
at m (three.min.js:150)
at m (three.min.js:150)
at Xd.render (three.min.js:185)
at timer (3d.js:499)

here’s my code

var loader = new THREE.ObjectLoader();
  loader.load( 'assets/tigad/rocket1.json', addModelToScene );
  
 // Load the Blender object to the scene
  function addModelToScene( geometry, materials ) {
    var model = new THREE.MeshBasicMaterial(materials);
    model = new THREE.Mesh( geometry, materials );
    model.scale.set(20,20.5,50);
    scene.add( model );

    animate(model);
  }



function animate(model) {

  // requestAnimationFrame( animate );
  // console.log(objnya)


  for (let i=0; i < objnyaArray.length; i++){
    console.log(objnyaArray[i]);



    setTimeout( function timer(){
      
   
       document.getElementById("roll").innerHTML = objnyaArray[i].x;
       document.getElementById("pitch").innerHTML = objnyaArray[i].y;
       document.getElementById("yaw").innerHTML = objnyaArray[i].z;

       model.rotation.z = 1 * objnyaArray[i].x * 0.0174533;
       model.rotation.x = objnyaArray[i].y * 0.0174533;
       model.rotation.y =  -1 * objnyaArray[i].z * 0.0174533;

        renderer.render( scene, camera );

        console.log('data putaran ke', i ,  objnyaArray[i] )
   }, i*1000 );


  }

it looks like you have your render function in a setTimeout in a render loop, and it isn’t waiting for the model to load before modifying model, you’ll want to look at the examples in the threejs repo like this: https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_json_claraio.html#L115-L132

thanks for your reference