heroku: no default language could be detected for this app
For future references, you must ensure that you are pushing the branch with your code to heroku master
.
If you branched from your master
branch and all your code is on a, say, develop
, push that to the heroku master.
So instead of:
git push heroku master
You would do something like:
git push heroku develop:master
This question has important details on this How to push different local Git branches to Heroku/master
Quick Solution
- Goto heroku dashboard (https://dashboard.heroku.com/)
- go inside app/project
- click setting
- scroll down little bit and click add build pack
- select your desired buildpack (in my case i have selected heroku/nodejs).
TLDR;
Actually what heroku does is, it tries to identify what project you are deploying by looking at files in your project, such as if your project have package.json
file it understands it is a nodejs project, if your project have requirements.txt
file it understands it is a python project and so on, see this document to see to know what languages you can run on a heroku server
as you know to run a specific project such as a nodejs project in a computer node runtime must be installed in that computer otherwise you can not nodejs app in the computer, what heroku does it runs each of your app in a different container, it means in one container it is only one app is running and of course that container have installed nodejs, so if a container runs only one app it doesnt make sense to install all other runtimes in the container so container have only one runtime in my case it is nodejs. they have ofcourse other type of containers such as one type for python and that container have installed python runtime(of a specific version) so if my app gets installed in python container it will not work because my app in in nodejs. for this very reason somehow we need to identify the type of app in beginning to choose correct container type, mostly heroku automatically detect it but if it is failed to detect you have to tell explicitly either by going to their dashboard settings or through runtime file in your project, and as you may have noticed you have do this only once.