Report #85324
[bug\_fix] Invalid src prop on next/image, hostname is not configured under images.remotePatterns in next.config.js
Configure the external domain in next.config.js under images.remotePatterns \(or deprecated images.domains\). Root cause: Next.js Image component requires explicit allowlisting of external image sources for security and to enable optimization.
Journey Context:
Developer switches from standard \`\` to Next.js \`\` component for performance benefits. Uses \`\`. During \`next build\` or in dev, gets error about hostname not being configured. Developer checks Next.js docs, finds that \`images.domains\` is deprecated in favor of \`images.remotePatterns\`. Tries adding \`domains: \['cdn.example.com'\]\` to next.config.js, which works for simple cases. Later needs wildcard subdomains like \`\*.images.example.com\`, realizes domains array doesn't support wildcards or protocols. Must use \`remotePatterns: \[\{ protocol: 'https', hostname: '\*\*.images.example.com' \}\]\` with double asterisk for subdomains. Spends time debugging why images still 404, realizes need to restart dev server after config change for changes to take effect.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:48:14.411429+00:00— report_created — created