Can not load .glTF file in three.js editor r82dev + GLTFLoader v2

Description of the problem
  1. Access to following URL
  2. [File] – [Import] – [Duck.gltf] select Duck.gltf file on the desktop
    -> Can not load Duck.gltf. Following error has been displayed on the console.
three.min.js:150 THREE.WebGLRenderer 82dev
Storage.js:75 [22:07:15] Saved state to IndexedDB. 1.94ms
Loader.js:22 Loading Duck.gltf (191 KB) 100%%
GLTFLoader.js:77 Synchronous glTF object access is deprecated. Use the asynchronous 'callback' argument instead.get scene @ GLTFLoader.js:77(anonymous function) @ Loader.js:168FileReader (async)Loader.loadFile @ Loader.js:173(anonymous function) @ Menubar.File.js:45
GLTFLoader.js:79 Uncaught ReferenceError: scene is not defined
    at Object.get scene [as scene] (
    at FileReader.<anonymous> ( scene @ GLTFLoader.js:79(anonymous function) @ Loader.js:168FileReader (async)Loader.loadFile @ Loader.js:173(anonymous function) @ Menubar.File.js:45
GLTFLoader.js:59 GLTFLoader: 130ms
GLTFLoader.js:67 Uncaught (in promise) TypeError: callback is not a function
    at GLTFParser.<anonymous> ( function) @ GLTFLoader.js:67(anonymous function) @ GLTFLoader.js:813Promise.resolve (async)_each @ GLTFLoader.js:593(anonymous function) @ GLTFLoader.js:1710Promise.resolve (async)_each @ GLTFLoader.js:593(anonymous function) @ GLTFLoader.js:1517Promise.resolve (async)_each @ GLTFLoader.js:593(anonymous function) @ GLTFLoader.js:1246Promise.resolve (async)_each @ GLTFLoader.js:593(anonymous function) @ GLTFLoader.js:955

In previous version (r81 + GLTFLoader v1) it will be displayed correctly.

Three.js version
  • Dev
  • r81
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Windows 10 + ThinkPad X201 Intel HD Graphics

Author: Fantashit

1 thought on “Can not load .glTF file in three.js editor r82dev + GLTFLoader v2

  1. The original issue (RawShaderMaterial did not update correctly) has been fixed by #10851.

    I think that re-assigning an object’s material should ‘just work’ (maybe also unset mesh.onBeforeRender?) but let’s open a new issue if there’s a problem there. GLTFLoader had been keeping an internal reference to these shaders, but isn’t anymore, so maybe that was the problem.

Comments are closed.