React app deployment to Netlify : Module not found: Error: Can't resolve './pages/HomePage' in '/opt/build/repo/src'

Viewed 620

Deplyment Error

How can I solve this error?

I tried many approaches like using Netlify CLI, linking to git and github but nothing worked.

The app works fine in development mode with no errors but it shows Error:404 page not found on both Netlify and Github Pages

The link of the deployed app

What should I do?

2 Answers

I found the solution, I changed the folders' names and pushed them into Github but Github didn't change the folders' names, and Netlify is case-sensitive towards nomenclature.

Check your directory names using gitbash terminal, as it works like a linux Netlify/Vercel are linux containers check the actual case using gitbash and fix the name as per the import enter image description here

Related