# Import model - error GLTFLoader

**URL:** <https://discourse.threejs.org/t/import-model-error-gltfloader/16485>\
**Category:** Questions\
**Tags:** gltf-format, javascript\
**Created:** [June 23, 2020, 9:13am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485 "2020-06-23T09:13:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evil\_Google](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/evil_google/32/11834_2.png) [@Evil\_Google](https://discourse.threejs.org/u/Evil_Google)\
**Post date:** [June 23, 2020, 9:13am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/1 "2020-06-23T09:13:24Z")

</div>

Good day.  
I’m in the lesson - [https://threejs.org/docs/#manual/en/introduction/Loading-3D-models](https://threejs.org/docs/#manual/en/introduction/Loading-3D-models). Stumble into the problem here when loading the model. Error in GLTFLoader.

```
My code:
        import * as THREE from 'three';
        import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader';

        var scene = new THREE.Scene();
        var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
        var renderer = new THREE.WebGLRenderer();
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.getElementById('main_site').appendChild(renderer.domElement);

        var loader = new THREE.GLTFLoader();
        loader.load('models/model.gltf', function (gltf) {

            scene.add(gltf.scene);
        }, undefined, function (error) {

            console.error(error);
        });

```

Place of error: new THREE.GLTFLoader();  
Errors webpack: "export ‘GLTFLoader’ (imported as ‘THREE’) was not found in ‘three’  
Error browser: TypeError: **WEBPACK\_IMPORTED\_MODULE\_0\_three**.GLTFLoader is not a constructor

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 23, 2020, 9:27am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/2 "2020-06-23T09:27:28Z")

</div>

> [@Evil\_Google](#):
>
> `var loader = new THREE.GLTFLoader();`

Try to create the loader like this:

```js
var loader = new GLTFLoader();

```

So without the `THREE` namespace.

---

<div class="post-metadata">

**Author:** ![Evil\_Google](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/evil_google/32/11834_2.png) [@Evil\_Google](https://discourse.threejs.org/u/Evil_Google)\
**Post date:** [June 23, 2020, 11:21am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/3 "2020-06-23T11:21:38Z")

</div>

```
ОК.
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';

var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById('main_site').appendChild(renderer.domElement);

var loader = new GLTFLoader();
loader.load('models/model.gltf', function (gltf) {

    scene.add(gltf.scene);
}, undefined, function (error) {

    console.error(error);
});

```

Another problem came out!  
Error: THREE.GLTFLoader: Failed to load buffer “model.bin”  
wtf - bin ?? What?

I load model - model.gltf. What is an error **bin**?

---

<div class="post-metadata">

**Author:** ![Evil\_Google](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/evil_google/32/11834_2.png) [@Evil\_Google](https://discourse.threejs.org/u/Evil_Google)\
**Post date:** [June 23, 2020, 11:23am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/4 "2020-06-23T11:23:25Z")

</div>

[model.gltf](https://discourse.threejs.org/uploads/short-url/9U3XelQmxHcGDaOVzMGLygnTLbX.gltf) (1.1 KB)  
Here is my model

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 23, 2020, 11:27am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/5 "2020-06-23T11:27:06Z")

</div>

`glTF` files can exist in different representations. In your case, `model.gltf` refers to a separate file called `model.bin` holding the actual buffer data.

It is possible to embed all data in a `glTF` file or to produce a binary archive file which has the `glb` extension. In production, you normally want to use the latter format.

---

<div class="post-metadata">

**Author:** ![Evil\_Google](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/evil_google/32/11834_2.png) [@Evil\_Google](https://discourse.threejs.org/u/Evil_Google)\
**Post date:** [June 23, 2020, 11:30am UTC](https://discourse.threejs.org/t/import-model-error-gltfloader/16485/6 "2020-06-23T11:30:07Z")

</div>

Thank. I’ll try to figure out model.bin. I will try glb
