0

I'm deploying my Django-backend, React-frontend app to Heroku and when running git push heroku master I'm running into a weird error:

Could not find a required file.
Name: index.html
Searched in: /tmp/build_7abd977a/public

Apparently when running npm run build it creates a build folder with the following structure:

enter image description here

Looks like for some reason the public folder isn't created upon running the scripts, can someone advice how can I perhaps create it with the script or run my index.html from a different location (Or at least tell me the location of the file its being imported in)?

Here is the full traceback:

enter image description here

7
  • First try running python manage.py collectstatic locally to verify that you are able to collect all the static files. Heroku does that. Commented Feb 16, 2021 at 8:09
  • give this a try stackoverflow.com/a/59575383/6562458 Commented Feb 16, 2021 at 16:16
  • neither worked but thank you Commented Feb 17, 2021 at 10:21
  • 1
    @SLDem Could you add any more of the error. Is there anything that comes before it? What stage of the build is it in whilst this error is displayed? Commented Feb 18, 2021 at 17:38
  • @tim-mccurrach I've added the traceback after installing node_modules Commented Feb 19, 2021 at 7:07

1 Answer 1

0

I fixed it by moving my portfolio-frontend contents into the root of the project and then running npm run build again.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.