title: Invalid Host error when deploying a create-react-app on Heroku
body: <p>When I deploy my React app on Heroku, I receive an Invalid Host error. </p>
  
  <p>When I search for a reason, I find this in the docs: <a href="https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#invalid-host-header-errors-after-configuring-proxy" rel="nofollow noreferrer">https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#invalid-host-header-errors-after-configuring-proxy</a></p>
  
  <p>However, when I create an .env file and include the HOST, I receive this error:</p>
  
  <pre><code>Attempting to bind to HOST environment variable: XXX.herokuapp.com
  If this was unintentional, check that you haven't mistakenly set it in your shell.
  
  Could not find an open port at XXX.herokuapp.com.
  Network error message: listen EADDRNOTAVAIL 52.205.227.252
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>UPDATE: I've set the HOST variable to the Heroku url both via the .env file and through the Heroku CLI, but I'm still getting the above error.</p>