Loading...
Loading...
Error: Invalid src prop on `next/image`, hostname is not configured under images in your `next.config.js`The Next.js Image component only allows images from domains you explicitly whitelist in next.config.js. This prevents malicious image injection and allows Next.js to optimize images safely.
Whitelist the external image domain in your Next.js config.
// next.config.mjs
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
{
protocol: 'https',
hostname: '**.amazonaws.com', // wildcard subdomain
},
],
},
};
export default nextConfig;