Any*_*are 8 heroku firebase reactjs webpack firebase-authentication
连接到Firebase并添加以下域:
Heroku域到授权域后,当我尝试[ Heroku open] 时出现以下错误:
应用程序中发生错误,无法提供您的页面.如果您是应用程序所有者,请检查日志以获取详细信息.
日志非常混乱:
2017-10-15T19:43:14.249135 + 00:00 heroku [router]:at = error code = H10 desc ="App crashed"method = GET path ="/ favicon.ico"host = aqueous-lake-87719.herokuapp .com request_id = c837ed1c-0d44-497b-88d6-0cc72e062771 fwd ="197.37.44.69"dyno = connect = service = status = 503 bytes = protocol = http
我的Package.json:
"name": "boilerplate",
"version": "1.0.0",
"description": "Simple react application",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=test karma start",
"build": "webpack",
"start": "npm run build && node server.js"
},
Run Code Online (Sandbox Code Playgroud)
我的server.js:
var express = require('express');
// Create our app
var app = express();
const PORT = process.env.PORT || 3000;
app.use(function (req, res, next){
if (req.headers['x-forwarded-proto'] === 'https') {
res.redirect('http://' + req.hostname + req.url);
} else {
next();
}
});
app.use(express.static('public'));
app.listen(PORT, function () {
console.log('Express server is up on port ' + PORT);
});
Run Code Online (Sandbox Code Playgroud)
Github上的应用程序: React-Todo
我在heroku上部署了你的应用程序并发现了同样的503错误.然后我在npm run build本地跑,意识到它不起作用.因为redux缺少.它可能对您有用,因为您可以redux在全球范围内安装.
添加后
"redux": "^3.7.2",
Run Code Online (Sandbox Code Playgroud)
到了package.json,并再次推应用程序,它工作得很好,我能够访问应用程序,但它在初始化火力地堡连接,您可以轻松地修复JS错误
| 归档时间: |
|
| 查看次数: |
494 次 |
| 最近记录: |