Reputation: 938
I have images in one folder while one of the images is getting imported easily the second one isn't being found
import img from '../Img/a292.jpg';
// import img from '../Img/building5.png';
export default function First() {
return (
<section id="first" className="d-flex justify-content-center align-items-center">
<img src={img} alt="img"/>
</section>
)
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
EDIT: Things I have tried src={require('../Img/a292.jpg')}
and I have tried to convert the image to png
because all the PNG-s were working so I thought it's the format that meters,but no didn't work :/
Upvotes: 2
Views: 543
Reputation: 749
I have an exotic solution, It's happening very rarely but it might happen to you, Change the name to numbers like 123.jpg It might happen that the letter a is in Russian and English or something like that, just try
Upvotes: 1
Reputation: 11
Well, I've faced the same issue and I do the following to import images:
Upvotes: 0