GLTF loader fails to load texture, despite getting 200 result?

I got a new GLTF format model from SketchFab.

When I try to load the model using the r124 GLTFLoader object, I get “net::ERR_FAILED 200 (OK)” errors for the textures, as you can see in the Chrome DevTools screenshot below.

This is strange because my server shows the files as being successfully retrieved:

And so does Chrome DevTools:

In fact, I can copy and paste the URL that shows in the error message and it displays fine in my browser, as you can see below.

Why is the GLTFLoader throwing an error?

have you investigated your first error?
Cannot use import statement outside a module

That’s unrelated to the problem I posted. That error is in regards to a completely different code module that is for a different animation model than the one I’m having trouble with (the one I am referring to in this thread).

have you tried exporting the model as a single .glb file from blender, you’ll have everything in one file and you’ll save one additional request,(I think you can apply a metallic map as an image texture in blender )

good luck ,

1 Like

u must set sketchfab to allow Cross-Origin Resource Sharing (CORS)

That’s the bigger problem. I have Blender but I don’t know how to use it (yet). Sadly it appears that many of the models sold on commercial 3D model sites like TurboSquid, SketchFab, etc. expect the buyer to have 3D editor skills. Unfortunately you don’t find out which ones aren’t “ready to go” until you buy and download the model(s).

1 Like

Why would that matter? The 3D model files are hosted on my web site as you can see from the error messages in the debugger screenshots I posted.

1 Like

The only model reference I can see in your console seems to be an fbx file is that the model you’re referring to?

1 Like

Thanks XAR. So the journey is over (unless I see a non-GLB format model I really want to have). From here on in, I only buy models that have a GLB format. Luckily the Piccolo spider robot had a GLB file. I just loaded that and it displays and works fine in in ThreeJS (see screenshot):

Note to my fellow ThreeJS devs that don’t have artist skills. TurboSquid has terrific support but unfortunately:

  • Most of the models I was interested in did not have GLB format available
  • Either their search doesn’t have the ability to filter by model format or I couldn’t figure out how to filter by model

But luckily SketchFab has everything I need. I’ll be sticking with SketchFab for now. My two cents, your mileage may vary.

1 Like

In this case it’s the GLTF version, but all of the formats were a problem for me except for the GLB format, like XAR suggested. That format is my solution.