Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pages vite JS build not showing the images

Tags:

backend

vite

I'm trying to make simple portfolio using Github pages but something is wrong with the images. I can't load them. Can you help me how to fix that?

enter image description here

https://xakepa.github.io/Portfolio/

Here is my build folder. I used Vite and Three libraries https://github.com/xakepa/Portfolio/tree/main/dist

like image 447
Simba Avatar asked Oct 21 '25 04:10

Simba


1 Answers

I found the problem. It was in the loading. For example

const spaceTexture = new THREE.TextureLoader().load("./images/space.jpg");

The problem was in the patch I tried ("./images/space.jpg"); or ("/images/space.jpg"); but these working only local, doesn't work in github pages.

The correct way is without any dash or dot and

("images/space.jpg");
like image 61
Simba Avatar answered Oct 24 '25 10:10

Simba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!