hiteshchoudhary / Music-school-hindi

A basic introduction to nextjs with awesome UI
187 stars 22 forks source link

Error [ Image Optimization ] #5

Open nsgpriyanshu opened 2 months ago

nsgpriyanshu commented 2 months ago

Sir, actually the image.domain function isn't working.

Instead of that, I think we have to use the image.remote as per the latest next.js documentation.

next.config.mjs

module.exports = {
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 's3.amazonaws.com',
        port: '',
        pathname: '/my-bucket/**',
      },
    ],
  },
}
ShubhamPatilSp commented 1 month ago

Use this brother and let me know if error comes up.

/* @type {import('next').NextConfig} / const nextConfig = { images:{ domains: ['images.unsplash.com', 'res.cloudinary.com'] } };

export default nextConfig;

nsgpriyanshu commented 1 month ago

Use this brother and let me know if error comes up.

/* @type {import('next').NextConfig} / const nextConfig = { images:{ domains: ['images.unsplash.com', 'res.cloudinary.com'] } };

export default nextConfig;

Thank you, the problem has already been fixed.