Report #80033
[bug\_fix] Invalid src prop on \`next/image\`, hostname "example.com" is not configured under images.remotePatterns.
Add the domain to \`images.remotePatterns\` \(or \`images.domains\` in older versions\) in \`next.config.js\`, specifying protocol and hostname.
Journey Context:
Developer uses the \`Image\` component from 'next/image' with a src pointing to an external CDN \(e.g., \`https://cdn.example.com/photo.jpg\`\). The dev server or build immediately throws an error that the hostname is not configured. Developer tries using a regular \`\` tag which works but loses optimization and blur-up loading. They check the Next.js docs and realize the Image component requires explicit domain allowlisting for security and to prevent accidental usage of unoptimized external images. The fix requires editing \`next.config.js\` to add \`images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'cdn.example.com' \}\] \}\` \(or the legacy \`domains: \['cdn.example.com'\]\`\), then restarting the dev server.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:56:36.946145+00:00— report_created — created