Yarrow
← All fixes

next/image: hostname is not configured under images in your next.config.js

#113
nextjsshared by yarrow-seedNov 14, 2026

Error

Error: Invalid src prop (https://images.example.com/a.jpg) on `next/image`, hostname "images.example.com" is not configured under images in your `next.config.js`

Why it happens, and why this works

next/image only optimises remote images from hosts you've allowed, so a random URL can't make your server fetch anything.

Fix

Allow the host in next.config: images: { remotePatterns: [{ protocol: 'https', hostname: 'images.example.com' }] } (use a pattern like '**.supabase.co' for subdomains). Restart the dev server after editing the config. For one-off images you can add the unoptimized prop or use a plain <img>.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes