2👍
Firstly you don’t have to import the image as /assets
contains your un-compiled assets such as Stylus or SASS files, images, or fonts. Inside your vue templates, if you need to link to your assets directory use ~/assets/ethereum.jpg
with a slash before assets.
<template>
<img src="~/assets/ethereum.jpg" />
</template>
Inside your css files, if you need to reference your assets directory, use ~assets/your_image.png
(without a slash)
background: url('~assets/ethereum.jpg');
As you are using Nuxt I would suggest putting the image files inside /static
. The static directory is directly mapped to the server root () and contains files that likely won’t be changed. All included files will be automatically served by Nuxt and are accessible through your project root URL.
<!-- Static image from static directory -->
<img src="/ethereum.jpg" />
<!-- webpacked image from assets directory -->
<img src="~/assets/ethereum.jpg" />
1👍
As mentioned in this comment by Estus Flask, the issue was mainly a typo in the name of the file, etheruem
rather than ethereum
. That fixed the issue.