-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image URL in srcset not set correctly #167
Comments
What version are you using @thmsnhl ? |
This is a known issue (see #166) |
Latest version is It would be nice if you can try it and if not working sharing your repository. |
Oh sorry, I also had a typo in the version number. I use latest version which is indeed I'll try to validate the payload on my own, unfortunately I am not allowed to share the repository. |
So I took a look into ...
return {
data: [
{
article: {...},
_img: {
'/_img/remote/_/w_640/https://the.api.url/assets/iStock-1146697288.jpg': 'e1474b.jpg',
'/_img/remote/_/w_750/https://the.api.url/assets/iStock-1146697288.jpg': '7ee5ad.jpg',
'/_img/remote/_/w_828/https://the.api.url/assets/iStock-1146697288.jpg': '624500.jpg',
'/_img/remote/_/w_1080/https://the.api.url/assets/iStock-1146697288.jpg': 'a6ac68.jpg',
'/_img/remote/_/w_1200/https://the.api.url/assets/iStock-1146697288.jpg': '524fa4.jpg',
'/_img/remote/_/w_1920/https://the.api.url/assets/iStock-1146697288.jpg': '077a17.jpg',
'/_img/remote/_/w_2048/https://the.api.url/assets/iStock-1146697288.jpg': 'c79f8d.jpg',
'/_img/remote/_/w_3840/https://the.api.url/assets/iStock-1146697288.jpg': '9cd549.jpg',
'/_img/remote/_/_/https://the.api.url/assets/iStock-1146697288.jpg': '1e1413.jpg',
},
}
]
}
... Does this help to debug the issue? |
I've just run into a similar issue to yours, When I load an image from the assets folder I get this
However if I use a hosted image like the following, it works fine:
Any ideas what's happening here? Thanks in advance |
You cannot use ~ inside the src, images has to be inside the static/ directory in order for the image modules to proxy it |
I have a pull request to add When I turn I am using:
I think maybe sometimes the static images hydrate properly but then maybe they don't load properly from cache? |
@shadow81627 Vercel preset is automatically enabled in vercel environment (https://image.nuxtjs.org/providers/vercel). Maybe you can try providing sizes or explicitly set preset: static in nuxt.config? 1200 is one of them: https://daim-a6mjo9p9u-damienrobinson.vercel.app/_vercel/image?url=/img/portfolio/scuber.jpg&w=1200&q=100 |
I think the original issue should be solved with #236 (though I realise there are some other issues here too). I'm closing it; please create a new issue if needed. 🙏 |
I am using
nuxt-img
in a project with deployment target "static", images are pulled from a Content Management System and not locally hosted.I do not specify a provider or define any other options in
nuxt.config.js
.When running
nuxt generate
everything seems to be working as intended and the build logs output✔ Generated static image dist/_nuxt/image/{HASHED-FILENAME}.jpg
for every image. But when I inspect the DOM, the created<picture>
-Elements contain a lot of<source>
-Elements with the initial image URL instead of the freshly generated one.The text was updated successfully, but these errors were encountered: