I\'ve been searching around on this one for a while and can\'t find anything that seems to be applicable in my situation. I\'ve been staring at these logs and I can\'t see w
I had the main entry in package.json
pointing at the wrong directory. Ensure it is pointed to the build output directory. As for my case, I had the server file in the /bin folder so I set my package.json
{
"main": "build/bin/www.js"
"scripts": {
"start": "node ."
}
}
To create a heroku account
$heroku create
To verify your git configration is well
$git remote -v
Associate a Git repo with an existing application
$heroku git:remote -a herokuapp-name
To perform push to master
$git push heroku master
To get your database to work you will have to migrate to production database
$heroku run bundle exec rake db:migrate
Then restart
heroku restart
finaly browse to your location
I have also faced this error, overall this error means that It can't work with your dependencies and one of the reason may be old versions of dependencies. I solved this by following two steps: 1) I updated all my dependencies manually. 2) I changed my Flask API from app.py to err.py (could be helpful to have different name, but not necessary.
This worked for me. Hope, it helps!!
In my case it was because I was hardcoding the port to be used,
I changed using this, and it worked
app.listen(process.env.PORT || 3000);
Try following steps:
- git push heroku master # if not done
- heroku run rake db:migrate
- heroku restart
Wait couple of minutes...
In my case, I was working with express on ES6 using babel, the babel was imported as devDependency (Heroku ignores devDependencies in production) after including them into dependencies it worked for me.
"dependencies": {
"@babel/register": "^7.8.3",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4"
}