部署React App返回`这个页面使用了React的开发版本,尽管已经执行了`npm run build`

时间:2017-11-29 18:29:15

标签: reactjs heroku deployment

目前我正在https://selly-midtrans.herokuapp.com/中创建一个简单的反应应用,但是当我部署它时,它给了我一些错误enter image description here

我已按照https://reactjs.org/docs/optimizing-performance.html#use-the-production-build进行操作,因此我运行了heroku run npm run build但似乎没有改变我的作品中的任何内容

任何建议人员?我非常感谢你的任何建议

1 个答案:

答案 0 :(得分:0)

默认的heroku buildpack将运行npm start,这将启动开发服务器。

您需要使用https://github.com/mars/create-react-app-buildpack来实际构建应用的生产版本并提供静态资产。