ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Vercel and Cloudinary giving INVALID_IMAGE_OPTIMIZE_REQUEST in Nextjs

Categories: Reactjs

When using Nextjs image they will work fine locally, but you need to configure the trusted domains for deployments on real domains.

module.exports = {
  images: {
    formats: ['image/avif', 'image/webp'],
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'res.cloudinary.com',
        port: '',
        pathname: '/YOUR-ACCOUNT/**',
      },
    ],
  },
}