Describe the bug
Normally, using GLTFLoader to load the model in js does not cause any problems. But when I use webworker, I use GLTFLoader in the worker to load the model. I found that the model obtained in the onload function lacks pictures. After my analysis, I found that when this piece of picture information was loaded in the FILELoader inside GLTFLoader, it had disappeared in its onload function. The magic is that I can temporarily solve this problem through the onprogress method. I added a load stage judgment to onprogress, and then obtained the correct arraybuffer data from this event.
To Reproduce
Steps to reproduce the behavior:
Code
// code goes here
function initGltf(gltfInfo) {
new GLTFLoader().load(gltfInfo.url, (e) => {
//I will get wrong data here
}, (e) => {
if (e.loaded === e.total) {
let data = e.target.response
//I will get right data here
}
})
}
Expected behavior
GLTFLoader.onload function can run well when i use webworker
Screenshots

Platform:
At least with latest Chrome, GLTFLoader should use ImageBitmapLoader for loading textures. Unlike TextureLoader, ImageBitmapLoader does work in a worker. It also has no dependency to FileLoader. Hence, I'm a bit irritated why you are mentioning this:
I found that when this piece of picture information was loaded in the FILELoader inside GLTFLoader
Independently, there is no official web worker support for GLTFLoader, see https://github.com/mrdoob/three.js/issues/15090#issuecomment-431463709.
At least with latest Chrome,
GLTFLoadershould useImageBitmapLoaderfor loading textures. UnlikeTextureLoader,ImageBitmapLoaderdoes work in a worker. It also has no dependency toFileLoader. Hence, I'm a bit irritated why you are mentioning this:I found that when this piece of picture information was loaded in the FILELoader inside GLTFLoader
Independently, there is no official web worker support for
GLTFLoader, see #15090 (comment).
I am sorry for my analysis, maybe there are some errors.I don't have a deep understanding of the source code. But the phenomenon I mentioned above does exist, how should I solve it.Can you help me ?
@misitetong Please use the forum for help requests. You can login with your GitHub account.
Most helpful comment
At least with latest Chrome,
GLTFLoadershould useImageBitmapLoaderfor loading textures. UnlikeTextureLoader,ImageBitmapLoaderdoes work in a worker. It also has no dependency toFileLoader. Hence, I'm a bit irritated why you are mentioning this:Independently, there is no official web worker support for
GLTFLoader, see https://github.com/mrdoob/three.js/issues/15090#issuecomment-431463709.