Report #55359
[bug\_fix] Invalid src prop ... hostname is not configured under images in your \`next.config.js\`
Add the external domain to images.remotePatterns \(or legacy images.domains\) in next.config.js and restart the dev server. Root cause: Next.js Image Optimization API \(/\_next/image\) requires explicit allowlisting of external hostnames for security \(preventing abuse\) and to enable build-time validation.
Journey Context:
Developer deploys a CMS-driven site using where the URL is https://cdn.sanity.io/.... The dev server throws the error with the specific hostname. Developer checks the Image src and sees it's a valid HTTPS URL. They search the error and land on Next.js docs for remotePatterns. They open next.config.js and add images: \{ remotePatterns: \[\{ protocol: 'https', hostname: 'cdn.sanity.io', pathname: '/\*\*' \}\] \}. They restart the server \(important because config is read at startup\). The image now loads and is optimized via the local /\_next/image endpoint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:24:34.978652+00:00— report_created — created