Short answer
Add the image’s address to images.remotePatterns in next.config.js, with the same protocol, hostname, port and path the src uses. In our experience you then need to restart the dev server or redeploy before the change shows. Most cases we see are a missing subdomain, such as storage or cdn in front of the domain.
Why next/image rejects the image, and the fix
01
The image host isn’t in remotePatterns
“Each part of the src value is strictly matched against your images.remotePatterns definitions.” Next.js, next/image Un-configured Host
Pictures from a storage bucket, a CMS or another site need their own entry. Add the address with a path pattern that covers the images, and keep it as narrow as the real paths.
module.exports = { images: { remotePatterns: [new URL('https://assets.example.com/account123/**')], }, }02
The pattern is close, but not exact
“Hostname: example.org is different from www.example.org and from subdomains like assets.example.org” Next.js, next/image Un-configured Host
A pattern for the bare domain doesn’t cover www or a subdomain, and https doesn’t cover http. A port, such as a local server on 3000, has to be listed too, and a path like /images/ needs /** to match the files under it.
03
The project still uses images.domains
“Deprecated since Next.js 14 in favor of strict remotePatterns in order to protect your application from malicious users.” Next.js, Image component
Older projects and some AI-generated code list hosts under images.domains. Move them to remotePatterns, which can also limit the protocol, port and path.
04
The image doesn’t need optimizing
“This is useful for images that do not benefit from optimization such as small images (less than 1KB), vector images (SVG), or animated images (GIF).” Next.js, Image component
For an SVG logo, a GIF or a tiny icon, you can set unoptimized on that one image so Next.js serves it as it is. We also prefer this to opening remotePatterns to every host.
Checked against the vendor’s docs on : Next.js docs: next/image Un-configured Host; Next.js docs: Image component.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Next.js hydration error · Vercel 404 on a Ready deployment · Next.js DynamicServerError · Next.js Server Action body limit