Image Element Not Displaying - src Attribute Issues
Images aren't showing on the page. You see the broken image icon or blank space where images should be.
The image tag exists in HTML but the source isn't loading.
Error Messages You Might See
Common Causes
- Image path is incorrect or relative path doesn't resolve properly
- Image file is in public/ but path doesn't start with /
- Image stored outside public folder and not bundled
- CORS issue if loading from external domain
- Image lazy loading but loading attribute wrong
How to Fix It
For static files in public folder: use absolute path /image.jpg not ./image.jpg
Use Next.js Image component: import Image from 'next/image';
For dynamic sources: ensure URL is accessible from browser (not internal API)
Check Network tab in DevTools - does image request get 404 or 403?
Use alt attribute always for accessibility and SEO
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
Where should I put images?
Public folder: /public/image.jpg, then reference as /image.jpg. Or use next/image with src prop
What's the benefit of Next.js Image component?
Automatic optimization, lazy loading, responsive sizes, WebP conversion. Always use it for best performance
Why would image work locally but not on deploy?
Relative paths don't work. Use absolute /paths or next/image component