2017-10-15 57 views
8

連接到火力地堡後,並添加以下領域: Heroku Domain到授權域,我得到以下錯誤,當我嘗試[Heroku open]:不開的Heroku應用程序可以連接到火力

錯誤發生在應用程序和您的頁面不能 送達。如果您是應用程序所有者,請查看日誌以獲取詳細信息。


日誌是如此混亂:

2017-10-15T19:43:14.249135 + 00:00的Heroku [路由器]:在=錯誤代碼= H10 DESC =「應用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 =狀態= 503字節=協議= 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" 
    }, 

我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); 
}); 

在Github上的應用: React-Todo

回答

7

我在heroku上部署了您的應用程序,並發現相同的503錯誤。然後我在本地跑npm run build並意識到它不起作用。因爲缺少redux。它可能爲你工作,因爲你可能在全球安裝redux

加入

"redux": "^3.7.2", 

package.json,並再次推應用程序後,它工作得很好,我能夠訪問應用程序,但它在初始化火力地堡連接,您可以修復JS錯誤容易

Firebase error

相關問題