2017-07-21 18 views
0

Google App Engine newbie here。ReactアプリをGoogle App Engineにデプロイするときに502サーバーエラーが発生しました

私はGoogleにアプリを反応させるのマイ展開してきましたが、私はそれをプレビューしようとすると、502エラーが出る:

Failed to load resource: the server responded with a status of 502() 

app.yamlを:

env: flex 
runtime: nodejs 

package.json:

{ 
    "name": "react-boilerplate", 
    "version": "1.0.0", 
    "description": "Minimal boilerplate for react", 
    "main": "index.js", 
    "scripts": { 
    "start": "node server.js", 
    "bundle": "./node_modules/.bin/webpack --config webpack.config.js", 
    "prestart": "npm run bundle" 
    }, 
    "author": "", 
    "license": "ISC", 
    "babel": { 
    "presets": [ 
     "es2015", 
     "react", 
     "stage-2" 
    ] 
    }, 
    "engines": { 
    "node": "6.11.0", 
    "npm": "3.10.10" 
    }, 
    "devDependencies": { 
    "babel-core": "^6.24.1", 
    "babel-loader": "^7.0.0", 
    "babel-preset-es2015": "^6.24.1", 
    "babel-preset-react": "^6.24.1", 
    "babel-preset-stage-2": "^6.24.1", 
    "css-loader": "^0.28.0", 
    "node-sass": "^4.5.2", 
    "sass-loader": "^6.0.5", 
    "style-loader": "^0.16.1", 
    "webpack": "^3.0.0", 
    "webpack-dev-server": "^2.4.5" 
    }, 
    "dependencies": { 
    "axios": "^0.16.2", 
    "d3": "^4.9.1", 
    "express": "^4.15.3", 
    "pug": "^2.0.0-rc.2", 
    "react": "^15.5.4", 
    "react-dom": "^15.5.4", 
    "react-redux": "^5.0.5", 
    "redux": "^3.7.1", 
    "redux-thunk": "^2.2.0", 
    "webpack": "^3.3.0" 
    } 
} 

webpack.config.js:

var webpack = require('webpack'); 

module.exports = { 
    entry: [ 
    './src/index.js' 
    ], 
    module: { 
    loaders: [ 
     { 
     test: /\.jsx?$/, 
     exclude: /node_modules/, 
     loader: 'babel-loader' 
     }, 
     { 
     test: [/\.css$/, /\.scss$/], 
     exclude: /node_modules/, 
     loaders: ['style-loader', 'css-loader', 'sass-loader'] 
     } 
    ] 
    }, 
    resolve: { 
    extensions: ['*', '.js', '.jsx'] 
    }, 
    output: { 
    path: __dirname + '/dist', 
    publicPath: '/', 
    filename: 'bundle.js' 
    }, 
    devServer: { 
    contentBase: './dist', 
    historyApiFallback: true 
    }, 
    plugins: [ 
    new webpack.DefinePlugin({ 
     'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) 
    }) 
    ] 
} 

アイデアが不足しています。どんな助けも素晴らしいだろう!

+0

webpack HMRサーバーの 'server.js'はありますか?本番環境での実行では推奨されていません。純粋なJSブラウザ側のアプリケーションにはGAEのようなものは必要ありません。あなたは[Google Cloud Storage](https://cloud.google.com/storage/docs/hosting-static-website)のようなものを見てください。 FYI、 '502'は通常、' Bad Gateway'を意味し、 'あなたが探していた上流のサーバと通信できませんでした。 ' –

+0

HMRとは何ですか、それが私のwebpack HMRサーバーであるかどうか調べるにはどうすればいいですか?申し訳ありませんが、このすべてに少し新しい – doctopus

+0

Nevermind、私は解決策を考え出しました。私の答えは以下の通りです – doctopus

答えて

0

問題を解明しました。私はすべてのモジュールをdevDependenciesからdependenciesに移動する必要がありました。

関連する問題