<img
src={siswa.url}
alt={`Profile of ${siswa.nama1}`}
className={styles.image}
onError={(e) => {
console.error("Image failed to load:", e.target.src);
e.target.style.display = "none"; // Hide the broken image
}}
/>
on the console chrome it say failed to load and also when I browse the link it say Cannot GET /images/e45c416f7e189371d42a196f2bacf989.jpg
<img
src={siswa.url}
alt={`Profile of ${siswa.nama1}`}
className={styles.image}
onError={(e) => {
console.error("Image failed to load:", e.target.src);
e.target.style.display = "none"; // Hide the broken image
}}
/>
on the console chrome it say failed to load and also when I browse the link it say Cannot GET /images/e45c416f7e189371d42a196f2bacf989.jpg
/images/e45c416f7e189371d42a196f2bacf989.jpg
This looks like a relative path. You can try to use an absolute image path(full root path of the image on your machine) to see if the issue is caused by your image path; If the problem still exists, check if your backend server is setup serve static files