question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v-for image not found 404 using nuxt-image

See original GitHub issue

If 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
farnabazcommented, Nov 17, 2020

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.

0reactions
mkluehcommented, Dec 23, 2021

Seems there is an option to be able to use the static directory https://image.nuxtjs.org/api/options#dir

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found