Report #104682
[bug\_fix] Error: Invalid src prop on next/image, hostname "example.com" is not configured under images.remotePatterns
Add the hostname to \`next.config.js\` under \`images.remotePatterns\` with the appropriate protocol and optional pathname pattern.
Journey Context:
A developer added a third-party image URL to an \`\` component from Next.js. In development, it worked fine, but in production build, the image failed to load and the server returned a 500 error with the remotePatterns message. They checked the Next.js documentation for Image Optimization and discovered that by default, Next.js only allows images from the same origin. To allow external images, they must be explicitly whitelisted in \`next.config.js\`. They added \`remotePatterns: \[\{ protocol: 'https', hostname: 'example.com' \}\]\` and redeployed. The fix also required restarting the dev server for the changes to take effect.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:09:32.353966+00:00— report_created — created