(react) react cant locate my local img file

An hour ago my code was all good and i had no problems but suddenly react cant locate the img file i use for the background of my website. I tried everything and i dont know why i have this problem, can someone plz help

error message: ./src/assets/css/main.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/assets/css/main.css)Module not found: Can't resolve '../../images/bali.jpg' in 'F:\react\plz\src\assets\css'


You’re searching it 2 directories up.

Just remove the ../../ and instead put a ./../

2 Likes

thanks man hahah it was that easy :joy:

It’s confusing at first.

../ : parent directory
./ : current directory

Also, and this is just a side comment, ../../ probably wouldnt work, because, if I remember well, anything should be either on public or src and ../../, just in case you fall into it at some point.

Good luck :slight_smile:

1 Like