Home > Software design >  Module not found: Can't resolve 'Umma.PNG' in 'C:\Users\Zaid Mohammed\Ummanet
Module not found: Can't resolve 'Umma.PNG' in 'C:\Users\Zaid Mohammed\Ummanet

Time:12-26

I am trying to import an image from the source file "Umma.PNG" , on the code if you hover the cursor on the link it shows the image however on the executable page its returning this error ./src/Header.js Module not found: Can't resolve 'Umma.PNG' in 'C:\Users\Zaid Mohammed\Ummanetic\ummanetic\src'

The error image

Can anyone help me insert the image

CodePudding user response:

The image should be imported with the full path. eg: "../../image/umma.png"

CodePudding user response:

You cannot assign the files directly(as a static link). You need to import it like an file or library.

import MyImage from './where/is/image/path/umma.png'

And you can use it like below:

<img src={MyImage} alt="its an image" />
  • Related