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.

Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. zipking zipking I am a technologist and product builder dedicated to creating high-impact solutions at the intersection of AI and specialized markets. Currently, I am focused on PropScan (EstateGuard), an AI-driven SaaS platform tailored for the Japanese real estate industry, and exploring the potential of Archify. As an INFJ-T, I approach development with a "systems-thinking" mindset—balancing technical precision with a deep understanding of user needs. I particularly enjoy the challenge of architecting Vertical AI SaaS and optimizing Small Language Models (SLMs) to solve specific, real-world business problems. Whether I'm in a CTO-level leadership role or hands-on with the code, I thrive on building tools that turn complex data into actionable value. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. 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. Milan Surelia Milan Surelia Milan Surelia is a Mobile App Developer with 5+ years of experience crafting scalable, cross-platform apps at 7Span and Meticha. At 7Span, he engineers feature-rich Flutter apps with smooth performance and modern UI. As the Co-Founder of Meticha, he builds open-source tools and developer-focused products that solve real-world problems. Expertise: 💡 Developing cross-platform apps using Flutter, Dart, and Jetpack Compose for Android, iOS, and Web. 🖋️ Sharing insights through technical writing, blogging, and open-source contributions. 🤝 Collaborating closely with designers, PMs, and developers to build seamless mobile experiences. Notable Achievements: 🎯 Revamped the Vepaar app into Vepaar Store & CRM with a 2x performance boost and smoother UX. 🚀 Launched Compose101 — a Jetpack Compose starter kit to speed up Android development. 🌟 Open source contributions on Github & StackOverflow for Flutter & Dart 🎖️ Worked on improving app performance and user experience with smart solutions. Milan is always happy to connect, work on new ideas, and explore the latest in technology. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. Matt Butler Matt Butler Software Engineer @ AWS Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap.

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