I am trying to deploy my react app to aws-amplify but I keep getting this error in the build process in aws.
When I run the app in production, "yarn run build" it runs fine locally, but when I push my changes to aws I get the following error:
"Failed to compile.
2020-07-26T15:51:52.356Z [INFO]: ./src/index.js
Cannot find file './App' in './src'.":
more detailed aws error image attached
My folder structure is as follows:
- public
- favicon.ico
- index.html
- logo192.png
- logo512.png
- manifest.json
- robots.txt
- src
- assets
- components
- Contact.js
- Home.js
- Navigation.js
- NotFound.js
- Project.js
- Projects.js
- App.css
- App.js
- App.test.js
- contact.css
- home.css
- index.css
- index.js
- logo.svg
- projects.css
- serviceWorker.js
- setupTest.js
- .gitignore
- package.json
- README.md
- yarn.lock
You are including file App.css but there is only app.css. Fix the case of the first letter.
Some operating systems (or better said, some file systems) are case-sensitive. You have to write the name of the file correctly.
If you are using a versioning system (e.g. git), make sure you have renamed the file in the versioning system. On a case-insensitive file system a change in case won't be detected.
For others that come here:
It's likely you have different casings for your folder or file names in your master/main and develop or other branches.
To make git case sensitive use:
git config core.ignorecase false
and then commit again.