Report #13406
[bug\_fix] Invalid src prop on next/image, hostname is not configured under images.remotePatterns
Add the external domain to next.config.js under the images.remotePatterns array with protocol and hostname \(and optional pathname\).
Journey Context:
Developer tries to use the optimized next/image component with an external CMS image URL like https://cdn.example.com/image.jpg. During development or build, Next.js throws an error stating the hostname is not configured. Developer initially considers switching to a regular tag to bypass the error, but loses the automatic optimization, blur placeholders, and layout stability. They search the Next.js docs and find that next/image requires an explicit allowlist for security and optimization reasons. The fix involves editing next.config.js to add images.remotePatterns with the specific protocol and hostname. After restarting the dev server, the image loads with full Next.js optimization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:42:39.529504+00:00— report_created — created