The change, that let’s FileLoader cache duplicate requests by default, introduced a problem, when aborting a request before it’s loaded.
XMLHttpRequest.abort() does not tirgger ‘load’ or ‘error’ events but instead an ‘abort’ event.
Because that event is not handled, the request will be stuck in the FileLoaders ‘loading’ object, that is used to determine, if a file is already loading.
By adding a listener for ‘abort’ this could be prevented:
request.addEventListener( 'abort', function ( event ) {
... handle the same way an error would be handled
}, false );
I’m not sure, if handling it as an error is the way to go, because aborting has to be called on purpose, but this is how i do it for now.
Three.js version
- r88+
Browser
- All of them
OS
- All of them
I think it’s okay if the engine internally handles this case as an error (in the sense of the request was not completed as expected). The code of the new event handler could be equal to the current one for the
error
event:three.js/src/loaders/FileLoader.js
Lines 224 to 240
in
6201c9a