Report #96597
[bug\_fix] Invalid src prop on next/image, hostname is not configured under images.remotePatterns
Add the domain or pattern to \`images.remotePatterns\` \(or legacy \`domains\`\) in \`next.config.js\`, then restart dev server. Root cause: Next.js Image Optimization API requires explicit allowlisting of external domains for security and to prevent abuse of the image optimization service.
Journey Context:
Developer sets up a blog using Next.js and a headless CMS \(Contentful\). Uses next/image to render images from the CMS. Writes: \`\`. Immediately gets error about hostname not configured. Developer tries adding the full URL, still fails. Searches error message. Finds Next.js docs on images.remotePatterns. Opens next.config.js. Adds: \`images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'cdn.contentful.com' \}\] \}\`. Restarts dev server \(crucial step\). Error resolved.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:43:30.960161+00:00— report_created — created