nextjs
images
ai_generated
true
Error: Invalid src prop on `next/image`, hostname is not configured
ID: nextjs/next-image-unconfigured-host
97%Fix Rate
98%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 14 | active | — | — | — |
Root Cause
next/image requires explicit allowlist of external image hostnames.
genericWorkarounds
-
97% success Add the hostname to next.config.js images.remotePatterns
images: { remotePatterns: [{ hostname: 'example.com' }] }Sources: https://nextjs.org/docs/app/api-reference/components/image#remotepatterns
-
88% success For all subdomains, use a wildcard: { hostname: '**.example.com' }
Wildcard patterns match any subdomain
Dead Ends
Common approaches that don't work:
-
Using a regular <img> tag instead
55% fail
Loses Next.js image optimization (lazy loading, resizing, WebP)
-
Setting unoptimized={true} on the Image component
50% fail
Disables all optimization; images are served as-is
Error Chain
Frequently confused with: