# Loading sketchfab gltf file in a create-react-app

**URL:** <https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338>\
**Category:** Questions\
**Created:** [May 20, 2019, 12:52am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338 "2019-05-20T00:52:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![geeberry](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@geeberry](https://forum.babylonjs.com/u/geeberry)\
**Post date:** [May 20, 2019, 12:52am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/1 "2019-05-20T00:52:32Z")

</div>

Hi there! Pretty new to WebGL in general but after messing with both three and babylon all weekend I like Babylon way more.

I’m attempting to load a simple gltf model from sketchfab into a React app. After finding other posts and tutorials online I believe I’m doing everything correctly except the model doesn’t want to load textures.  
Heres the error I get in the console:

```
    index.js:1437 BJS - [19:50:54]: Unable to load from tree/scene.gltf: loadAssets of unknown
	Materials:
		Name: 02_-_Default
		Name: 03_-_Default
		Name: 07_-_Default
console.<computed> @ index.js:1437

index.js:1437 BJS - [19:50:54]: Unable to load from tree/scene.gltf: Error in onSuccess callback

```

However the assets are there in the /public folder called tree, including my textures. I can’t seem to figure this out. The file loads just fine in the Bablyon Playground viewer. Any hints?

---

<div class="post-metadata">

**Author:** ![hcmetal](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hcmetal](https://forum.babylonjs.com/u/hcmetal)\
**Post date:** [May 20, 2019, 2:49am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/2 "2019-05-20T02:49:27Z")

</div>

Hi @geeberry,

Welcome to the community!

A bit more information might be needed for us to help you.

Are you able to successfully load the gltf file without React? I don’t think this is a problem with React

Could you create a Play Ground example?  
[https://doc.babylonjs.com/features/playground](https://doc.babylonjs.com/features/playground)

To load external assets:  
[https://doc.babylonjs.com/resources/external\_pg\_assets](https://doc.babylonjs.com/resources/external_pg_assets)

Or maybe you can share that gltf file so I can examine it?

Cheers

---

<div class="post-metadata">

**Author:** ![geeberry](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@geeberry](https://forum.babylonjs.com/u/geeberry)\
**Post date:** [May 20, 2019, 2:57am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/3 "2019-05-20T02:57:30Z")

</div>

Hi there! Thank you

I’m following this example pretty much: [https://codesandbox.io/s/91n29pnqko](https://codesandbox.io/s/91n29pnqko)

With the assets being in the /public folder.

The only difference between that example is mine is my /public/sword folder contains the textures in a texture folder. The example I provided doesn’t have a textures folder.

My files are [here](https://github.com/westeroscraftcode/westeroscraft-site/tree/develop) in the componets/organisms/tree folder and the gltf in the public folder

---

<div class="post-metadata">

**Author:** ![hcmetal](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hcmetal](https://forum.babylonjs.com/u/hcmetal)\
**Post date:** [May 20, 2019, 3:02am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/4 "2019-05-20T03:02:13Z")

</div>

Please try putting the textures in the same folder of gltf file, instead of having its own subfolder.

Let me know if this works 🙂

---

<div class="post-metadata">

**Author:** ![geeberry](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@geeberry](https://forum.babylonjs.com/u/geeberry)\
**Post date:** [May 20, 2019, 3:07am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/5 "2019-05-20T03:07:38Z")

</div>

Ok, did that, and now getting a new error

```
BJS - [22:04:28]: Unable to find a plugin to load .gltf files. Trying to use .babylon default plugin. To load 
from a specific filetype (eg. gltf) see: http://doc.babylonjs.com/how_to/load_from_any_file_type

```

So I think I need to hunt down a plugin! Thanks for your help

---

<div class="post-metadata">

**Author:** ![hcmetal](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@hcmetal](https://forum.babylonjs.com/u/hcmetal)\
**Post date:** [May 20, 2019, 3:10am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/6 "2019-05-20T03:10:06Z")

</div>

👍  
Hope things work out soon. Let me know if you run into any more problems.

---

<div class="post-metadata">

**Author:** ![geeberry](https://avatars.discourse-cdn.com/v4/letter/g/ecae2f/32.png) [@geeberry](https://forum.babylonjs.com/u/geeberry)\
**Post date:** [May 20, 2019, 3:24am UTC](https://forum.babylonjs.com/t/loading-sketchfab-gltf-file-in-a-create-react-app/3338/7 "2019-05-20T03:24:04Z")

</div>

Got it to work! Heres my solution for anyone searching for a similar problem in the future:

Just be sure to import the npm loader module from[this link](https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview%20release/loaders) and import it into your scene file 🙂
