Heroku "Could not find a required file. Name: index.html"

Viewed 1116

I have been running into this error "Could not find a required file. Name: index.html" when I attempt to deploy my React Portfolio to Heroku. I have looked at previous answers and I have not found a solution. I do not have my public folder in .gitignore and I will attach a photo to show. file snapshot

Do I need to add certain "scripts" in my package.json that I may be missing. I also tried buildpacks after watching a youtube tutorial and that did not seem to work either.

2 Answers

If you're deploying from Git, anything gitignored will not be included in what gets deployed. Rather than ignoring the whole public directory, you could ignore only some files, for example public/*.js.

EDIT: see comments, I misread the question.

The solution to this was that I did not have all my files at the route. Simple as that, I just needed to delete the parent folder and move all files to the route of the directory. I had them nested within 2 folders, I had moved them out of one of those folders thinking it was at the route but it needed to go one more folder out and that was the issue that I was having.

Related