nuxt / image

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

Prismic provider with netlify #1348

Open JosBouma opened 6 months ago

JosBouma commented 6 months ago

I'm deploying a site to Netlify using Nuxt Image with Prismic as the provider. In my nuxt config i got:

  image: {
    prismic: {}
  },

Locally everything (run dev/generate) works as intended and src looks like this:

https://images.prismic.io/[reponame]/ZjD8LEMTzAJOCcrE_pdf-remotetechteam.png?auto=format,compress

When i deploy to Netlify the images don't display. On Netlify the src has a relative URL like so:

/.netlify/images?w=947&h=795&url=https:%2F%2Fimages.prismic.io%2F[reponame]%2FZjD8LEMTzAJOCcrE_pdf-remotetechteam.png?auto=format,compress

Am I doing something wrong or is this a bug?

danielroe commented 6 months ago

For now, would you set provider: 'prismic' explicitly? It looks like the Netlify environment is leading Nuxt Image to override your custom provider, which is a bug.

JosBouma commented 6 months ago

Setting it explicitly like you said fixed the issue, thanks!

  image: {
    // prismic: {}
    provider: 'prismic'
  },