Report #54639
[bug\_fix] Invalid src prop \(link\) on \`next/image\`, hostname "images.unsplash.com" is not configured under images in your \`next.config.js\`
Open \`next.config.js\` \(or \`next.config.mjs\`\) and add the external hostname to the \`images.remotePatterns\` array \(or \`images.domains\` for legacy\). Example: \`images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'images.unsplash.com' \}\] \}\`
Journey Context:
Developer is building a blog with Next.js App Router. They copy an image URL from Unsplash and paste it into the \`src\` prop of \`next/image\`. The dev server immediately throws an error: 'Invalid src prop... hostname is not configured'. Developer is confused because regular \`\` tags work fine. They search the error and find that Next.js Image component requires explicit domain allowlisting for security and optimization reasons \(to prevent abuse of the optimization API\). They open \`next.config.js\` and see \`images: \{ domains: \[\] \}\`. They add 'images.unsplash.com' to the domains array. The error persists because they used the \`remotePatterns\` format incorrectly \(missing protocol\). They correct it to \`remotePatterns: \[\{ protocol: 'https', hostname: 'images.unsplash.com', port: '' \}\]\`. After restarting the dev server, the image loads with Next.js optimization \(blur placeholder, responsive sizing\). They understand that \`next/image\` is not just an img tag but a sophisticated optimization component that needs to know which external domains it is allowed to proxy and optimize.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:12:22.641862+00:00— report_created — created