Netlify not showing my images in vite react

my site : https://raptor-test-store.netlify.app/

Hello, I am using the translator, when I upload my project in netlify it does not show the images, I already did the build and the images are in the dist/assets/images folder but I do not understand why it would not be working, I appreciate your help

This is a code issue, not a Netlify problem. Please consult Vite’s documentation: Static Asset Handling | Vite (vitejs.dev)

1 Like

@LeanCodE You’ve done most things right (for Vite), but your references in the HTML are incorrect.

You have:

image

  1. You cannot go “one directory up” from the root
    Netlify doesn’t host anything above the root, or outside of the Publish directory

  2. There is no public folder in your output
    As per the Vite documentation linked by @hrishikesh, the files in public get copied into the build output folder (dist) when the build runs.

So your files are actually available here:

https://raptor-test-store.netlify.app/images/froganti1.jpeg
https://raptor-test-store.netlify.app/images/reelhuevomonster1.jpeg

To fix, you should change your src references on the images to be root relative.

E.g. Adjust them to /images/froganti1.jpeg and /images/reelhueevomonster1.jpeg

1 Like