good evening. unfortunately we have a problem with a recent change.
our gltf models are no longer loaded. The chrome console reports
Uncaught TypeError: THREE.GLTFLoader is not a constructor
everything worked until a few days ago.
could someone help me with troubleshooting?
Mugen87
December 30, 2022, 8:24pm
2
How do you import GLTFLoader
into your app?
Mugen87
December 30, 2022, 8:25pm
4
Then please read the following topic. It should explain what’s happening:
three.js is going to remove its examples/js directory in the next release r148. That means addons like GLTFLoader or OrbitControls will only be available as ES6 modules in the examples/jsm directory.
What does that mean for me?
If you are already using ES6 modules, it won’t be necessary to update your workflow. Only if you are using the third-party libraries ammo.js, Draco or Basis from the repository, you will have to update your import paths e.g. from /examples/js/libs/draco to /examples/jsm…
Mugen87
December 30, 2022, 8:29pm
8
Also keep in mind to not import library files from https://threejs.org
. Always use a CDN like unpkg.com
with versioned URLs. E.g. https://unpkg.com/three@0.148.0/build/three.module.js
.
1 Like