Images not loading React

I do deploy in netlify and everything seems to be fine but when I enter I see that some images from the project do not load even though it looks for them in the static / media directory, is there a solution for this?

The app is made with React

my page

ty

@EliasPiscitelli Welcome to the Netlify community.

Each of your images loads for me. I’m not seeing any errors. I am seeing that some of your large images are not optimized, though. On a slow connection, they may be taking awhile to download.

I think, her means, the images here: https://todo-aca.netlify.app/todo-aca/profile. As you can see, the Social icons won’t load and they have the path static/media

The solution is simply to change ./static/media/facebook.5ef64e31.svg to /static/media/facebook.5ef64e31.svg (notice the removal of .).

Maybe, but that page has other serious problems, such as two HTML files with .js filename extensions that are called as if they were JavaScript.

That’s probably the way React has rendered it. If you go on the link he has originally posted and then click on any of those cards, the page I linked loads fine. It just doesn’t open directly.

It’s just us guessing though.

But how do I change the path if it is given by netlify when doing the npm run build

Netlify doesn’t give you any path. It’s your source code that must have that path.

This is the route of my images

import rightfilter from '../assets/right-filter.png';
import logoslider from "../assets/logo-slider.png";
import fondobuscar from "../assets/buscarfondo.jpg";
import filterJson from '../assets/dataJson/filtros.json';
import facebook from "../../assets/icons/facebook.svg";
import instagram from "../../assets/icons/instagram.svg";
import whatsapp from "../../assets/icons/whatsapp.svg";

Sadly, this is not going to help much. A repo would be needed.

2 Likes