How to display images from all domains in Next.js
ยท One min read
To allow Next.js to display images from all domains, modify your "next.config.js" file to add an object with protocol and hostname properties to the "remotePatterns" array property.
tip
Use ** in next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
}
};
export default nextConfig;