"No default language could be detected for this app" while using multiple Buildpacks for an app on Heroku

1k views Asked by At

I deploy to Heroku two nodejs projects each one in own folder -
NodejsExpressApp1 and NodejsConsoleApp1.

I have added to the app root the Procfile file with the following content -
web: node NodejsExpressApp1/app.js
worker: node NodejsConsoleApp1/app.js

Also I have set the BUILD_DIR config var to the NodejsExpressApp1 folder.

Locally everything works fine.

Below shown what I get while deploying -

c:\ExpressMultiProjectApp2>git push heroku master
Counting objects: 1506, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1401/1401), done.
Writing objects: 100% (1506/1506), 4.85 MiB | 92.00 KiB/s, done.
Total 1506 (delta 269), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     No default language could be detected for this app.
remote:                         HINT: This occurs when Heroku cannot detect     the buildpack to use for this application automatically.
remote:                         See     https://devcenter.heroku.com/articles/buildpacks
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to sheltered-mesa-74202.
remote:
To https://git.heroku.com/sheltered-mesa-74202.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sheltered-mesa-74202.git'`

Thanks!

1

There are 1 answers

0
Simon Borsky On

The issue was fixed after creation in the app root the package.json file -

{
    "name": "nodejs-express-app1",
    "version": "0.0.0",
    "description": "Multiple Buildpacks App",
    "author": { "name": "SimonBor" },
    "dependencies": {
        "express": "~4.9.0"
    }
}

Setting variable BUILD_DIR is not necessary step.

Of course it is not the best practice solution but it allowed me to continue development.
I will be more then happy for a better solution.

Best regards!