【发布时间】:2018-12-25 10:33:02
【问题描述】:
当我在 Heroku 上部署我的 React 应用程序时,我收到了 Invalid Host 错误。
当我搜索原因时,我会在文档中找到:https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#invalid-host-header-errors-after-configuring-proxy
但是,当我创建 .env 文件并包含 HOST 时,我收到此错误:
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
我做错了什么?
更新:我已经通过 .env 文件和 Heroku CLI 将 HOST 变量设置为 Heroku url,但我仍然收到上述错误。
【问题讨论】:
标签: reactjs heroku create-react-app