Report #10105
[bug\_fix] Invalid src prop \(domain not configured\) on next/image with external URL
Add the domain to next.config.js under images.remotePatterns \(or domains for older versions\). Root cause: Next.js Image optimization proxy requires explicit whitelisting to prevent SSRF and unauthorized bandwidth usage; only configured domains are fetched during build or runtime optimization.
Journey Context:
Developer switches from img to next/image for a CMS image at cdn.example.com. In dev, it works, but on build they get: 'hostname is not configured under images in your next.config.js'. They try adding domains: \['cdn.example.com'\] but miss the protocol. Checking the Next.js Image docs, they see the remotePatterns format requiring protocol and hostname. After updating next.config.js to include \{ protocol: 'https', hostname: 'cdn.example.com' \}, the image optimizes correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:50:09.988619+00:00— report_created — created