alexey kurbatov
alexey kurbatov

Reputation: 117

Cannot deploy to heroku because cannot find file

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:

enter image description here

And this is the file on my computer:

enter image description here

Seems like Github did not notice that I renamed this file

Upvotes: 0

Views: 257

Answers (2)

Jason
Jason

Reputation: 56

It's case sensitive. Make sure to keep your naming consistent.

Upvotes: 2

alexey kurbatov
alexey kurbatov

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

Related Questions