v-for image not found 404 using nuxt-image
See original GitHub issueIf I loop through an array with v-for the images are not found with a 404 error
<div v-for="image in product[0].images" v-bind:key="image.rank">
<nuxt-image :src="require(
~/assets/images/shop/${image.image_570xN})" />
</div>
but if I just use the img tag, the image is found
<div v-for="image in product[0].images" v-bind:key="image.rank">
<img :src="require(
~/assets/images/shop/${image.image_570xN})" />
</div>
Please can someone suggest a solution?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
vue.js - image not found in assets when using @error in Nuxt
I have a card component which has a structure for an image like this. One image can't be loaded ...
Read more >nuxt-img
Discover how to use and configure the nuxt-img component. ... Uses built-in provider to optimize local and remote images; Converts src to provider...
Read more >Nuxt Image doesnt show up after deploy - Support
The Console Error looks like this: https://thomaskohlmannhuber.netlif… ... Additionally, how large is the image you are trying to use?
Read more >Nuxt-Image Module 404 On Deploy To Netlify : r/vuejs - Reddit
Has anyone else been using nuxt-image? By default it comes with IPX, which locally works fine. When it get's deployed to Netlfiy, ...
Read more >Nuxt npm run generate (404 assets not found) - Vue Forum
All my files in the assets folder show as “404 not found”. In my components I reference the images like ~/assets…
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry for the late response. As you know Image module is WIP and the current version does not support assets. You should put your images inside
static
directory. But in the next release (ASAP) it will support assets too.I recommend to not use Image module on production or real projects. Wait until official announecment. The alpha release may have BREAKING CAHNGES for good.
Seems there is an option to be able to use the static directory https://image.nuxtjs.org/api/options#dir