Heroku code=H10 desc=“App crashed” - Can't figure out why it's crashing

前端 未结 6 1597
迷失自我
迷失自我 2020-12-09 08:50

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

相关标签:
6条回答
  • 2020-12-09 09:31

    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 ."
      }
    }
    
    0 讨论(0)
  • 2020-12-09 09:37

    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

    0 讨论(0)
  • 2020-12-09 09:38

    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!!

    0 讨论(0)
  • 2020-12-09 09:39

    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);
    
    0 讨论(0)
  • 2020-12-09 09:45

    Try following steps:

    - git push heroku master # if not done
    - heroku run rake db:migrate
    - heroku restart
    

    Wait couple of minutes...

    0 讨论(0)
  • 2020-12-09 09:47

    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"
    }
    
    0 讨论(0)
提交回复
热议问题