DEV Community

Discussion on: Causes of Heroku H10-App Crashed Error And How To Solve Them

Collapse
 
parables profile image
Parables

Okay, am back again on how to check your app for errors. In my previous case, it was a wrong import or a typo(better use Typescript to avoid these small typos) that was causing my app to crash locally.Fixing that solved it for both localhost and Heroku. But I was here again today because of the H10 error. It seems your article has now become my checklist whenever a deploying to Heroku. so to add a few tips:

  1. Run your code locally using npm and also with heroku local -a <heroku-app-name> . Make sure you test everything to make sure nothing crashes
  2. If you use .env vars, make sure to set them up in the Heroku config vars and beware of unwanted spacing in your config values. (In one case, my MongoDB Atlas con string had some unwanted spaces in my config value)
  3. Depending on your sever(esp. for Hapi), you must set your host to this:

host: process.env.HOST || '0.0.0.0' || 'localhost'

  1. Don't give up, check community support for the framework, library etc you are using, you are no the only one who has been stuck on that annoying bug. A problem shared is half solved.

That was why I was here today: I switched from Express to Hapi (just curiosity sake) only to meet this H10 error again. After lot of hours and multiple tabs of StackOverflow answers, I went to the Slack community of Hapi to seek help. It was then that I found out I needed step 3 above so make community support your last option before you even think of giving up