I have a very particular situation of a bug on loading using GLTFLoader
I have divided a space of my game in 10 parts, each with 20Mb of files. The first file has the walls, floor and top, the other 9 files has light, objects and stuff that are less important for the scene.
If I load all 10 files at once and then add them to the scene, all files load with no problem.
If I load the first file, put it in the scene and then after I load the 9 remaining files, the remaining 9 files have this error on load:
THREE.GLTFLoader: Couldn’t load texture
Promise {_state: 2, _handled: true, _value: TypeError: Cannot read properties of undefined (reading ‘createObjectURL’)
Trying to figure out what was going on…i came to the conclusion that all other files gives bug on loading if I load the user hand with this code:
let loader = new THREE.GLTFLoader();
let data={
src:‘https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/left.glb’
}
loader.load( data.src, function ( gltf ) {
object = gltf.scene.children[ 0 ];
Fun fact is this hand loads alright. But it affects the loading of all other files.
Right now my code works if i load the hand after i load all other glb files. But I dont see why the order of load would affect the program. I found a solution but i didnt find the reason.