I am displaying a WebGL renderer, written in typescript with React, any I am able to display my renderer, create geometry, interact with it and everything.
However anytime I try to use a loader (I have tried both Loader and GLTFLoader) I recieve an error in the runtime when the loader goes to collect either a local file or a file over http.
Currently I have it pointing directly to one of the free threejs resources, to make sure that I am pointing to a valid file, and just trying to print the data at each stage of the load.
this.loader.load('https://threejsfundementals.org/threejs/resources/models/cartoon_lowpoly_small_city_free_pack/scene.gltf'
, function ( gltf: any ) { console.log(gltf);
} , function (xhr: any ) { console.log(xhr);
}, function (e: any) { console.log(e);
}
);
In the runtime, I only see the data printed from the onProgress(xhr) callback, and the onLoad(gltf) and onError(e) functions are never called. However I recieve the following error immediately after the onProgress callback prints
react_devtools_backend.js:6 onerrorLogger: {"stack":"TypeError: Cannot read property 'response' of
undefined\n at https://localhost/res/ThreeDViewer/ThreeDViewer.js?
no_cache=1588859265686:40557:26\n at XMLHttpRequest.<anonymous>
(https://localhost/res/perspective/xhr-length-computable.min.js:3:10)","message":"Cannot read
property 'response' of undefined","name":"TypeError","logData":{"msg":"Uncaught
Exception","errorMsg":"Uncaught TypeError: Cannot read property 'response' of
undefined","url":"https://localhost/res/ThreeDViewer/ThreeDViewer.js?
no_cache=1588859265686","line number":40557,"column":26}}
And then the following error
ThreeDViewer.js?no_cache=1588859265686:40557 Uncaught TypeError: Cannot read property
'response' of undefined
at ThreeDViewer.js?no_cache=1588859265686:40557
at XMLHttpRequest.<anonymous> (xhr-length-computable.min.js:3)
When I dig into it, the error is happening at line 35816 in the three.js module, I have been racking my head against this for ages, any ideas?
Thanks for any help,
Keith G.