Just diving into learning Vue.js and embarking on a project that involves dynamically loading images in various ways.
However, upon running npm run dev
, I encountered crashed image icons along with this error in the console log:
GET http://localhost:8080/@/assets/images/myimage.svg 404 (Not Found)
In my code, there is a loop that utilizes a function to return an image path within an SVG element:
container.insertAdjacentHTML('afterbegin', `<image xlink:href="${setItem(i).filePath}" x="${x}" y="${y}" width="16" height="16"/>`)
Some of the images also load with or without utilizing a function to return their path, but not within an SVG element:
<image src="${setItem(i).filePath}" alt="">
<image src="@/assets/images/myimage.svg" alt="">
Despite trying these approaches, all images remain broken. Any insights into what might be going wrong?
P.S.: Suggestions for improving the title to better convey the issue are welcome!