Support Forums

Netlify not serving .glb files

I’ve recently put my personal portfolio on Netlify but it doesn’t seem to be loading the glb files which is what three.js uses for 3D models.

The site works locally and all the other files that are in the resources folder works without issue.

It gives me the error: Failed to load resource: the server responded with a status of 404 ()

My site is https://lucid-goldwasser-342418.netlify.app/

Any ideas would be very much appreciated.

Hi @blake-tisbury

This suggests the files were not deployed. Have you checked what files were deployed by checking either by downloading the deploy

Thank you for the reply @coelmay.
I just downloaded it and you are right, those files were not deployed.

How do I go about adding them?

In the JS, the path is /public/resources/earthlowpoly.glb however the file is found at I did find one file at /resources/earthlowpoly.glb so it appears they are deployed, you simply need to change the path in the JS for them.

I’ve been messing with it for the past couple of hours trying to get it to work. Just changed the path back to the one you said, didn’t seem to work. You said you saw the file there?

Ah, now it seems to be working, just took a second. Thank you so much!!

This is what I am seeing. I did not see the animation on the right earlier. Is that your file?

For anyone encountering this in the future, the issue was that I did not put my javascript resources (in this case 3D models but I assume it would be the same with images and other files) into a folder named “public”.
Creating a folder named public in the root directory and dragging dropping my old resources folder into there allowed the files to be served and accessed by the js file.

Strangely the files referenced in the index.html had no issues, it was only the javascript.