Can't display a website with three.js (File not found)

Hello guys,

Firstly, I want to say that three.js is awesome.

Secondly, I’m asking for a word of help. I have a problem with displaying a website. I saw a similar topic but it does not help in this case.

I started with this error:

Consequently, I set up a local server with python. It did not work and I got stuck after a few attempts of resolving the problem of the server not finding the files. I understood that the GLTFLoader.js could not find the three.module.js

So, I checked the GLTFLoader.js which I located in a ‘js’ folder. I checked it in the console. The path to three.module.js was wrong…

I changed the path to a “three.module.js” since I have both .js’ in the same ‘js’ file.

I did not resolve the problem. It looks like the server is still looking for the three.module.js in the old directory (build/three.module.js). I’m not sure how this is possible.


I would appreciate all the sentences of advice :slight_smile:

If you prefer to copy these files individually to your local server (as opposed to using a JS bundler or a hosted CDN like unpkg) then you probably don’t want to use the ES module versions — adjusting the relative imports isn’t fun. For an alternative to get the non-ES-module versions, downloading these two files…

… will create a global THREE object with THREE.GLTFLoader etc. attached.

2 Likes

I found cdnjs links which are super useful (https://cdnjs.cloudflare.com/ajax/libs/three.js/110/three.js) but I can’t find GLTFLader there… Do you know where it is available in this format?

Could you also recommend a good JS bundler?

Thank You

I simplified my tests and focused on uploading only. Can you tell me if anything is wrong with this code? The code is not giving me any errors in the console but the object.glb is not visible. I used the three.js and GLTFLoader @donmccurdy shared with me.


I will be super thanksful if you will help me :slight_smile: