I am struggling a bit with an strange error, where one of my images (nysl) for my projects section is not loading. Testing on my local dev server I have no issues, only on netlify is it not loading.
Adding a console.error I got the following output:
react_devtools_backend.js:6 Project → error Error: Cannot find module ‘./nysl.png’
at o (.$:19)
at r (.$:14)
at E (Project.js:26)
at ca (react-dom.production.min.js:154)
at So (react-dom.production.min.js:259)
at hu (react-dom.production.min.js:230)
at pu (react-dom.production.min.js:229)
at iu (react-dom.production.min.js:223)
at react-dom.production.min.js:121
at t.unstable_runWithPriority (scheduler.production.min.js:18)
In my code I am loading the images dynamically using context:
imgSrc is being supplied by the JSON, which is working for all the other images.
I have tried, changing the images itself. Double checking the JSON naming and filepaths. I have downloaded the website from netlify and I find the nysl image in the build, so it appears to be building correctly.
Honestly not sure where to go from here or where the error lies. Would really appreciate any support.
and just to confirm, you are not seeing the image in the website? (i didn’t see anything that looked like a broken image when i pulled up your site).
Usually if a path works locally or for some reasons but not for others it is either a case issue (our system may handle case differently than our local machine or something that is potentially causing problems in the .gitignore (if you have one). Can you double check on these two things please?