image icon indicating copy to clipboard operation
image copied to clipboard

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

Open petercsipkay opened this issue 2 years ago • 2 comments

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

petercsipkay avatar Oct 08 '23 09:10 petercsipkay

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

DavidDeSloovere avatar Oct 20 '23 14:10 DavidDeSloovere

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.

codeflorist avatar Mar 22 '24 12:03 codeflorist