Reputation: 117
I use heroku to deploy my react app. It used to work fine but now when I run the command
git push heroku master
I see the following error:
remote: Browserslist: caniuse-lite is outdated. Please run next command `npm update`
remote: Failed to compile.
remote:
remote: ./src/service/TodoService.js
remote: Cannot find file './constants' in './src/service'.
I spent more than an hour trying to figure out the cause. Tried answers from this and this. They did not help me. I decided to check the file that caused the build fail in my github repository and I found that its name was different from the name on my computer.
Here is the github:
And this is the file on my computer:
Seems like Github did not notice that I renamed this file
Upvotes: 0
Views: 257
Reputation: 117
Finally I found a solution. I used the answer from here. Basically you need to rename the file that causes build failure so git can track it.
git mv Constants.js constants.js
Then commit, push and make sure that the name on github is corrent. After that you should be able to successfully deploy to heroku
Upvotes: 0