Report #15318
[bug\_fix] Invalid src prop ... hostname is not configured under images.remotePatterns
Add the external domain to next.config.js under images.remotePatterns with protocol and hostname, or use unoptimized prop for specific images
Journey Context:
Developer uses the next/image component with a src URL pointing to an external CMS or CDN \(e.g., https://cdn.example.com/image.jpg\). In local development, the image loads fine because Next.js is more permissive in dev mode. After deploying to production with next start, images return 400 errors and the browser console shows errors about unconfigured hosts. Developer checks the Network tab and sees requests to /\_next/image?url=... failing. They read the error message which links to Next.js docs about configuring remotePatterns. They edit next.config.js to add images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'cdn.example.com' \}\] \}, rebuild and redeploy. The Image Optimization API now allows fetching from that domain, and images load with proper optimization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:46:56.611511+00:00— report_created — created