# How to load gltf format model with AssetsManager.addMeshTask

**URL:** <https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519>\
**Category:** Questions\
**Tags:** tutorial\
**Created:** [July 15, 2020, 3:02pm UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519 "2020-07-15T15:02:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![epcausaf](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@epcausaf](https://forum.babylonjs.com/u/epcausaf)\
**Post date:** [July 15, 2020, 3:02pm UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/1 "2020-07-15T15:02:33Z")

</div>

How to load gltf Model in Reactjs project with AssetsManager.addMeshTask  
I have successfully loaded .babylon model but I want to load .gltf model.  
How can I load the .gltf file model?

here is my code snippet

```auto
 loadModels = () => {
    let loader = new AssetsManager(this.scene)   
    let loadModel = loader.addMeshTask("test", "", "", "model.babylon")
    loadModel.onSuccess = ( t ) => {
       // do some code
       // .....
    }
    return loader
}

```

when I load  
loader.addMeshTask(“test”, “”, “/3Dmodel/”, “test\_2.gltf”)  
then it give this error

Unable to import meshes from /3Dmodel/test\_2.gltf: importMesh of unknown TypeError: Cannot read property ‘0’ of undefined  
at Function…/node\_modules/babylonjs/babylon.js.d.FromArray (babylon.js:1)  
at Function…/node\_modules/babylonjs/babylon.js.\_.Parse (babylon.js:1)  
at Object.importMesh (babylon.js:1)  
at babylon.js:1  
at d (babylon.js:1)  
at XMLHttpRequest.o (babylon.js:1)

> <https://stackoverflow.com/questions/62910740/how-to-load-gltf-model-in-babylonjs-reactjs-project>

Thanks

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 15, 2020, 6:50pm UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/2 "2020-07-15T18:50:19Z")

</div>

Did you make sure to reference the gltf loader?

---

<div class="post-metadata">

**Author:** ![epcausaf](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@epcausaf](https://forum.babylonjs.com/u/epcausaf)\
**Post date:** [July 16, 2020, 8:01am UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/3 "2020-07-16T08:01:51Z")

</div>

Thanks for the response.  
I am new to this.  
How can I make sure reference of “gltf loader” can you give me any example for this.

I am following this

> <https://github.com/mpwassler/3dproductview/blob/master/src/Components/Scene3d.js#LC118>

also, I get this tutorial  
[https://www.babylonjs-playground.com/#WGZLGJ](https://www.babylonjs-playground.com/#WGZLGJ)  
and I have successfully loaded gltf file through SceneLoader.Append method.  
but I want to load like AssetsManager.addMeshTask.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 16, 2020, 7:30pm UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/4 "2020-07-16T19:30:13Z")

</div>

AssetsManager.addMeshTask eventually calls SceneLoader.ImportMesh which is very similar to SceneLoader.Append. Can you repro this in the playground using AssetsManager.addMeshTask?

---

<div class="post-metadata">

**Author:** ![epcausaf](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@epcausaf](https://forum.babylonjs.com/u/epcausaf)\
**Post date:** [July 20, 2020, 6:17am UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/5 "2020-07-20T06:17:18Z")

</div>

@bghgary Thanks for guide.

---

<div class="post-metadata">

**Author:** ![epcausaf](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@epcausaf](https://forum.babylonjs.com/u/epcausaf)\
**Post date:** [July 20, 2020, 6:22am UTC](https://forum.babylonjs.com/t/how-to-load-gltf-format-model-with-assetsmanager-addmeshtask/12519/7 "2020-07-20T06:22:40Z")

</div>

@Deltakosh I understand your point when I import ‘babylonjs-loaders’; then addMeshTask successfully import gltf file.
