0

I am using my github repo to connect to heroku but when I click on deploy branch, I get the following error:

 !      No default language could be detected for this app.
        HINT: This occurs when Heroku cannot detect the buildpack to use for this application 
        automatically.
        See https://devcenter.heroku.com/articles/buildpacks

 !     Push failed

I think it's because my project has 2 folders (frontend and backend) and each of them have their own packages.json files. After researching, it seems that heroku needs packages.json in the root folder. Can I create a new packages.json file in the root? I need to deploy through github.

Can I just copy paste the packages.json from my backend to the root?

jas305
  • 89
  • 1
  • 8

1 Answers1

1

Deploying a frontend and backend to a single heroku instance is possible, but difficult. It's probably better to deploy them separately.

With that said the cause of your issue is indeed the lack of a package.json in your root directory. If you're using the free tier you'll only have 1 port open once you deploy, so you'll have to get creative with this. The following might be of use if you're insistent on getting both on a single app. Deploy the backend and frontend on the same Heroku app/dyno

nate998877
  • 73
  • 5