I'm trying to load images from a Nuxt component (not a page) like below:
<img
:src="require(`~/assets/logo/${imageCode}.svg`)"
@error="$event.target.src = require('~/assets/logo/error.svg')"
/>
But when an image doesn't exist, I'm getting the following error in the browser's console:
Error: Cannot find module './123.svg'
How should I deal with non-existing assets ?