Unverified Commit 5e6b008b authored by Steven's avatar Steven Committed by GitHub

Fix docs for next/image unconfigured hosts (#41223)


Fix docs for next/image unconfigured hosts to mention `remotePatterns`.
parent c6dc62ef
......@@ -2,11 +2,29 @@
#### Why This Error Occurred
On one of your pages that leverages the `next/image` component, you passed a `src` value that uses a hostname in the URL that isn't defined in the `images.domains` config in `next.config.js`.
One of your pages that leverages the `next/image` component, passed a `src` value that uses a hostname in the URL that isn't defined in the `images.remotePatterns` or `images.domains` in `next.config.js`.
#### Possible Ways to Fix It
Add the hostname of your URL to the `images.domains` config in `next.config.js`:
Add the protocol, hostname, port, and pathname to the `images.remotePatterns` config in `next.config.js`:
```js
// next.config.js
module.exports = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'example.com',
port: '',
pathname: '/account123/**',
},
],
},
}
```
If you are using an older version of Next.js prior to 12.3.0, you can use `images.domains` instead:
```js
// next.config.js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment