next/image Un-configured Host
next/image rejected a src hostname? Next.js says that host is missing from images.remotePatterns, and every part of the URL has to match.
Reviewed October 21, 2026
What it means in plain English
Next.js raises this when a next/image src uses a hostname that is not defined in images.remotePatterns in next.config.js. Matching is exact and case-sensitive. For a URL, the protocol, hostname, port, pathname, and search each have to match the pattern. A mismatch in any one part is rejected.
example.org is a different hostname from www.example.org and from assets.example.org. https does not match a pattern that only allows http. A port such as :3000 has to be in the pattern when the src has it.
Likely causes
- The live image URL is a subdomain, and
remotePatternsonly lists the apex host. - The pattern pathname is
/images/and the file sits under a deeper path. Next.js says the path has to be covered by a glob such as/**or/images/**. - A pattern built with
new URL(...)omittedsearch, so thesearchproperty is''and query strings are not allowed.
How to fix it, step by step
- Copy the
srcthat failed. Note its protocol, hostname, port, pathname, and query string. - Add a
remotePatternsentry that matches those parts. Next.js shows this shape, with its own example host:
module.exports = {
images: {
remotePatterns: [new URL('https://assets.example.com/account123/**')],
},
}
- To allow any search parameter, omit the
searchkey and use the object form Next.js shows:
module.exports = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'assets.example.com',
port: '',
pathname: '/account123/**',
},
],
},
}
- On Next.js before 15.3.0, the same page says to use the object form, including
search: ''when search params are not part of the URL. On Next.js before 12.3.0, it says to setimages.domainsto the hostname list instead. - Redeploy so the host builds with the new
next.config.js.
How to check it worked
- The page renders the image, and the un-configured host error is gone for that
src. - A URL that still differs by one part, such as
www, still fails. That is the exact match Next.js describes.
Sources
Related fixes
More Next.js errors fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.