v0 storage

Image Optimization Not Working with next/image

Images in your v0-generated Next.js application are either not being optimized by the next/image component, displaying broken placeholders, or failing to load entirely. The Image component shows errors about unconfigured domains, and images served from external sources are returned unoptimized at their original size.

This is particularly problematic for performance because unoptimized images are often the largest assets on a page, and v0 frequently references external image sources like Unsplash, Cloudinary, or user-uploaded content from various CDNs.

The next/image component requires explicit domain whitelisting in next.config.js, and v0 may not have added all the necessary domains to the configuration.

Error Messages You Might See

Error: Invalid src prop on next/image, hostname not configured Image with src has either width or height modified Error: Image Optimization using default loader is not compatible Warning: Image with src was detected as the Largest Contentful Paint
Error: Invalid src prop on next/image, hostname not configuredImage with src has either width or height modifiedError: Image Optimization using default loader is not compatibleWarning: Image with src was detected as the Largest Contentful Paint

Common Causes

  • External domains not whitelisted — next.config.js remotePatterns or domains array missing the image source domain
  • Using img tag instead of Image component — v0 generated standard HTML img tags that bypass optimization
  • Missing width and height props — Image component requires explicit dimensions or fill mode
  • Vercel image optimization quota exceeded — free tier limited to 1000 optimized images per month
  • Incorrect loader configuration — custom loader not returning proper URL format for the image CDN

How to Fix It

  1. Add remote patterns — configure next.config.js with images: { remotePatterns: [{ protocol: 'https', hostname: '**.example.com' }] }
  2. Replace img with Image — import Image from 'next/image' and replace all <img> tags with <Image> components
  3. Use fill mode for dynamic sizes — for images with unknown dimensions, use <Image fill sizes="100vw" /> inside a relative-positioned container
  4. Add blur placeholders — use placeholder="blur" blurDataURL="data:image/..." for better loading experience
  5. Configure custom loader — for Cloudinary or similar CDNs, create a custom loader function that generates optimized URLs

Real developers can help you.

Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ hanson1014 hanson1014 Full-stack developer experienced in fixing and deploying AI-generated apps from Lovable, Bolt.new, Cursor, and Replit. I specialize in debugging Supabase integration issues (auth flows, RLS policies, database connections), fixing broken deployments, resolving routing/blank screen problems, and cleaning up messy React/Vite codebases. I also build production apps with the Claude API and have shipped a Mac desktop dev tool (Nexterm from scratch. Based in Hong Kong, fast turnaround. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Jacek Rozanski Jacek Rozanski Senior PHP/Symfony developer and DevOps engineer with 20+ years of professional experience, running opcode.pl (web development agency, est. 2004). Day job: I'm the sole backend developer at merketing company where I own and maintain 11 PHP/Symfony microservices on AWS (ECS Fargate, RDS, S3, CloudFront), handle the full CI/CD pipeline (Bitbucket Pipelines, Docker), and manage monitoring with Sentry and CloudWatch. These services handle high request volumes in production every month. What I bring to AI-built apps: - I audit and fix security issues (OWASP methodology), performance bottlenecks, and architectural problems in codebases generated by Cursor, Claude Code, Lovable, Bolt, and v0 - I refactor AI-generated prototypes into production-grade applications with proper error handling, testing, and clean architecture (SOLID, DDD, hexagonal architecture) - I set up the infrastructure AI tools don't touch: AWS hosting, CI/CD pipelines, automated deployments, database optimization, monitoring, and alerting - I integrate external services: payment providers, email systems, partner APIs, SSO/auth Tech stack: PHP 8.x, Symfony, React, Next.js, PostgreSQL, MySQL, Docker, AWS (ECS, RDS, S3, SQS/SNS, CloudFront), Terraform, Supabase. I also use AI tools daily (Claude Code, Cursor) in my own workflow, so I understand both the strengths and the gaps in AI-generated code. Based in Poland (CET timezone). Available for async work and calls during EU/US business hours. Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. Nam Tran Nam Tran 10 years as fullstack developer Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I whitelist all subdomains for an image host?

Use remotePatterns with a wildcard: { hostname: '**.cloudinary.com' }. This matches any subdomain of cloudinary.com.

Should I use width/height or fill?

Use width/height when you know the image dimensions. Use fill when the image should fill its parent container responsively. Always provide sizes prop with fill.

How do I check if images are being optimized?

Open DevTools Network tab, filter by images, and check the URL. Optimized images are served from /_next/image with width and quality parameters.

Related v0 Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help