Image error, but still displays

I am using the following tag to display an image:

<img src="./images/expand.gif">

My directory structure is as follows:


When I load the page, the console displays the following error:

GET http://[ip address]:8080/images/expand.gif 404 (Not Found)

The page properly displays the image, and I can also right click the image and open in a new tab, and it displays.

What am I doing wrong?

I have also tried:

<img src="/images/expand.gif"> (does not load image)

<img src="images/expand.gif"> (loads image, but still has GET error)
1 Like

Not clear what the error is, but I think it’s only in local dev :grimacing:

Am I using the img tag correctly with regards to path and the like?

I just want to make sure that there’s not something else I should be doing.

1 Like

If you are using webpack, maybe some loaders like url loader needs to be accounted for as well, because it changes the asset paths. I’m not sure, it probably depends on your config. I would say deploy it, and if there’s no error, maybe … skip this for now :sweat:

1 Like