Report #10454
[bug\_fix] Invalid src prop on next/image \(unconfigured host\)
Add the external image domain to the \`images.remotePatterns\` \(or legacy \`domains\`\) array in \`next.config.js\`, specifying the protocol and hostname with port if needed, then restart the development server.
Journey Context:
Developer is building a blog with Next.js App Router. They use the \`\` component to display an avatar from a CMS: \`src="https://cdn.example.com/avatar.jpg"\`. The browser shows a broken image and the terminal shows 'Error: Invalid src prop \(cdn.example.com\) on \`next/image\`, hostname is not configured'. Developer tries using a regular \`\` tag which works but loses optimization. They try adding \`unoptimized\` prop which bypasses the check but defeats the purpose of Next.js Image. Realizing Next.js requires explicit allowlisting for security and to enable its optimization proxy, they navigate to next.config.js and add \`images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'cdn.example.com' \}\] \}\`. After restarting the dev server, the image loads with proper optimization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:45:19.321877+00:00— report_created — created