nuxt / image

Plug-and-play image optimization for Nuxt applications.
https://image.nuxt.com
MIT License
1.35k stars 272 forks source link

Nuxt image + Sanity CMS not generating the Images locally, getting always with CDN #1040

Closed petercsipkay closed 6 months ago

petercsipkay commented 1 year ago

I have a Nuxt 3 Setup and I would like to have the Images locally hosted so get them from a CDN and store in a projected on a static Generate.

If I generate the images, they are still pulled from the CDN and do not get the _nuxt/xyz URL.

"@nuxt/image": "^1.0.0-rc.3", "nuxt": "3.7.0",

no typescript in use

Modules:

modules: [ 'nuxt-simple-sitemap', '@nuxt/image', '@nuxtjs/tailwindcss', ['nuxt-gtag'], '@nuxtjs/sanity', ],

Nuxt Images:

image:{ sanity: { projectId: process.env.PROJECT_ID, dataset: 'production' } },

Component:

<NuxtImg :src="tool.mainImage.asset._ref" :alt="tool.title" width="426" height="426" loading="lazy" format="webp" placeholder />

Can anyone help I am doing something wrong or this is a New issue with the latest update

Website nextgentool.io

DavidDeSloovere commented 1 year ago

Are you missing the domains config entry? The domain of the CDN needs to be set to allow IPX to get those images. It's a protection mechanism. See: https://image.nuxt.com/get-started/configuration#domains

codeflorist commented 8 months ago

i'm trying this with storyblok. i'm putting domains: ['a.storyblok.com'] in the nuxt config, but generation does not download and serve the images locally.

could it be, that the feature described at https://image.nuxt.com/advanced/static-images is currently broken?

or does this feature only work, when using the IPX provider?

it seems OP also wasn't able to get this to work, since his site still has src="https://cdn.sanity.io... as the image sources.