Next.js · dev overlay

next/image hostname is not configured

what it looks like
Error: Invalid src prop (https://avatars.githubusercontent.com/u/1) on `next/image`, hostname "avatars.githubusercontent.com" is not configured under images in your `next.config.js`

What it means

next/image only optimizes remote images from hosts you allow. Avatars from GitHub or Google sign-in, Stripe product images and CMS images all need an entry.

Common causes

  • Showing session.user.image from an OAuth provider
  • Images from a CMS, S3 bucket or Supabase Storage

How to fix it

  1. Add the host to images.remotePatterns in next.config.ts
  2. Be specific (protocol, hostname, path) instead of allowing every host
next.config.ts
const nextConfig = {
  images: {
    remotePatterns: [new URL("https://avatars.githubusercontent.com/**")],
  },
};

works with Next.js 16.4.3 · React 19.3last verified

Prompt for Cursor or Claude Code

next/image rejects a remote hostname. Add a specific images.remotePatterns entry in next.config.ts for this host (protocol, hostname and a path pattern if possible). Don't allow all hosts.

Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Next.js error fixer.

next: skip the next one

Skip the setup. The VibeBoot SaaS Starter gives you auth, Stripe and a database already wired on Next.js 16.4.3, with AGENTS.md and .cursor/rules that keep your agent on the Next.js 16 conventions. $49, one-time.

14-day money-back guarantee · lifetime updates

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free