← All errors · Next.jsNext.js App Router & config errors
Invalid src prop on next/image, hostname is not configured
Exact error
Error: Invalid src prop (https://example.com/a.png) on `next/image`, hostname "example.com" is not configured under images in your `next.config.js`
What it means
next/image only optimizes remote images from hosts you explicitly allow.
Likely causes
- Loading an image from a new domain (e.g. Supabase Storage, a CDN) without allow-listing it.
How to fix it
Add the host to remotePatterns in next.config:
// next.config.js module.exports = { images: { remotePatterns: [ { protocol: 'https', hostname: 'example.com' }, { protocol: 'https', hostname: '*.supabase.co' }, ], }, };Restart the dev server. next.config changes are not hot-reloaded.
Prevent this next time
- Run `next build` (not just `next dev`) before every deploy; several of these errors only appear in production builds.
- Keep a checked-in `.env.example` listing every required variable.
FAQ
What does "Invalid src prop on next/image, hostname is not configured" mean?
next/image only optimizes remote images from hosts you explicitly allow.
What usually causes it?
Loading an image from a new domain (e.g. Supabase Storage, a CDN) without allow-listing it.
How do I fix it?
1. Add the host to remotePatterns in next.config: 2. Restart the dev server. next.config changes are not hot-reloaded.
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy