I tried everything I found on the web, Stackoverflow and Github, and I still can\'t make it.
I want to make a custom marker with a custom icon, but with my code belo
You don't need to use require. instead of giving iconUrl = "../assets/name" you only need to import your png or svg then you can give the source to your iconUrl. look at the example below:
// first import your image or svg
import heart from "../../images/other/love.svg";
// give the source to your icon
let loveIcon = L.icon({
iconUrl: heart,
iconRetinaUrl: heart,
iconAnchor: [5, 55],
popupAnchor: [10, -44],
iconSize: [25, 55],
});
// simply add it to your map
L.marker([28, 50], {
icon: loveIcon,
}).addTo(map);