and I have an image at resources/images/icons/search.svg
I don’t get an error running yarn dev (but i do if i change the pathname to a non-existent image), which indicates to me tat the image exists just fine on the server.
When I load the page, however, dev tools says that it’s looking for an image at domain.com/images/icons/search.svg, which doesn’t exist.
What am I doing wrong here?
And does anyone know the correct way to include an image in JS?
For non-SCSS it should be without the tilde (~), so just @images/icons/calendar.svg (as it was described here).
Edit: Oh, I notice that you dynamically use that asset. You should rather import it so the resource can be resolved at build time (based off this example):
import calendarIcon from '@images/icons/calendar.svg';
img_calendar.src = calendarIcon;