Report #45107
[bug\_fix] Invalid src prop hostname is not configured under images in your next.config.js
Add the external domain to images.remotePatterns in next.config.js with protocol and hostname, then restart the dev server. Root cause: Next.js Image component optimizes images via the /\_next/image endpoint. For security and performance, it only allows images from explicitly allowed external domains to be fetched and optimized.
Journey Context:
You are building a blog using Next.js 14 and a headless CMS like Contentful. You render an with src set to the CMS asset URL 'https://images.ctfassets.net/...'. The page loads but the image is broken. You check the console and see a 400 error from \`/\_next/image?url=...\` with the message 'Invalid src prop ... hostname is not configured'. You initially think it's a CORS issue or a malformed URL. You check the URL, it's valid. You read the error message carefully and realize Next.js requires whitelisting. You open next.config.js, add images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'images.ctfassets.net' \}\] \}, restart the server, and images load correctly through the Next.js optimization loader.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:10:47.488080+00:00— report_created — created