Report #93023
[bug\_fix] Invalid src prop ... hostname is not configured under images.remotePatterns in your next.config.js
Add the external image hostname to the \`images.remotePatterns\` array in \`next.config.js\`, specifying the protocol and hostname \(and optionally pathname\). For older Next.js versions, use \`images.domains\`. Root cause: The Next.js Image Optimization API restricts external images to prevent abuse and unauthorized usage of your image optimization quota; you must explicitly whitelist trusted domains.
Journey Context:
You're building a blog using Contentful as a headless CMS. The content includes images hosted on \`images.ctfassets.net\`. You use the Next.js \`\` component with \`src=\{post.imageUrl\}\`. In local development, it works because you might be using a placeholder loader, but when you deploy to Vercel, you get a 500 error or a build error stating the hostname is not configured. You check the error logs which explicitly mention \`images.remotePatterns\`. You open \`next.config.js\` and add: \`images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'images.ctfassets.net' \}\] \}\`. You redeploy, and the images load correctly through Next.js's image optimization service, which serves them as WebP with proper sizing. You realize this is a security feature to prevent arbitrary image URLs from using your optimization bandwidth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:43:35.659302+00:00— report_created — created