Сбой при развертывании Heroku - PullRequest
0 голосов
/ 29 мая 2018

Я создал простое приложение реагирования, которое по какой-то причине дает сбой при развертывании на heroku ... Сборка кажется успешной, но мой контент не отображается / есть ошибка.

Когда я проверяю свои логи герои, вот что я получаю.Но я не совсем уверен, в чем проблема ...:

Вот и мой github, так что вы можете увидеть детали кода / веб-пакета и т. Д .:

https://github.com/ReenaVerma/GOLIN-TEST

    ➜  GOLIN-TEST git:(master) ✗ heroku logs
    2018-05-29T09:54:48.686630+00:00 heroku[web.1]: State changed from starting to crashed
    2018-05-29T09:54:48.663859+00:00 heroku[web.1]: Process exited with status 1
    2018-05-29T13:17:50.600366+00:00 heroku[web.1]: State changed from crashed to starting
    2018-05-29T13:17:50.344394+00:00 app[api]: Set NPM_CONFIG_PRODUCTION config vars by user reena_verma@hotmail.com
    2018-05-29T13:17:50.344394+00:00 app[api]: Release v5 created by user reena_verma@hotmail.com
    2018-05-29T13:17:52.783893+00:00 heroku[web.1]: Starting process with command `npm start`
    2018-05-29T13:17:54.871172+00:00 heroku[web.1]: Process exited with status 1
    2018-05-29T13:17:54.787907+00:00 app[web.1]: 
    2018-05-29T13:17:54.787925+00:00 app[web.1]: > react-webpack-setup@1.0.0 start /app
    2018-05-29T13:17:54.787927+00:00 app[web.1]: > webpack-dev-server
    2018-05-29T13:17:54.787928+00:00 app[web.1]: 
    2018-05-29T13:17:54.796872+00:00 app[web.1]: sh: 1: webpack-dev-server: not found
    2018-05-29T13:17:54.801464+00:00 app[web.1]: npm ERR! file sh
    2018-05-29T13:17:54.801869+00:00 app[web.1]: npm ERR! code ELIFECYCLE
    2018-05-29T13:17:54.802095+00:00 app[web.1]: npm ERR! errno ENOENT
    2018-05-29T13:17:54.802332+00:00 app[web.1]: npm ERR! syscall spawn
    2018-05-29T13:17:54.803493+00:00 app[web.1]: npm ERR! react-webpack-setup@1.0.0 start: `webpack-dev-server`
    2018-05-29T13:17:54.803676+00:00 app[web.1]: npm ERR! spawn ENOENT
    2018-05-29T13:17:54.803895+00:00 app[web.1]: npm ERR!
    2018-05-29T13:17:54.804114+00:00 app[web.1]: npm ERR! Failed at the react- webpack-setup@1.0.0 start script.
    2018-05-29T13:17:54.804270+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    2018-05-29T13:17:54.814559+00:00 app[web.1]: 
    2018-05-29T13:17:54.814687+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
    2018-05-29T13:17:54.814750+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-05-29T13_17_54_805Z-debug.log
    2018-05-29T13:17:54.886992+00:00 heroku[web.1]: State changed from starting to crashed
    2018-05-29T13:17:54.889252+00:00 heroku[web.1]: State changed from crashed to starting
    2018-05-29T13:17:57.774256+00:00 heroku[web.1]: Starting process with command `npm start`
    2018-05-29T13:18:00.396955+00:00 heroku[web.1]: State changed from starting to crashed
    2018-05-29T13:18:00.367329+00:00 heroku[web.1]: Process exited with status 1
    2018-05-29T13:18:00.252378+00:00 app[web.1]: 
    2018-05-29T13:18:00.252404+00:00 app[web.1]: > react-webpack-setup@1.0.0 start /app
    2018-05-29T13:18:00.252406+00:00 app[web.1]: > webpack-dev-server
    2018-05-29T13:18:00.252407+00:00 app[web.1]: 
    2018-05-29T13:18:00.265715+00:00 app[web.1]: sh: 1: webpack-dev-server: not found
    2018-05-29T13:18:00.271867+00:00 app[web.1]: npm ERR! file sh
    2018-05-29T13:18:00.272232+00:00 app[web.1]: npm ERR! code ELIFECYCLE
    2018-05-29T13:18:00.272506+00:00 app[web.1]: npm ERR! errno ENOENT
    2018-05-29T13:18:00.272828+00:00 app[web.1]: npm ERR! syscall spawn
    2018-05-29T13:18:00.274432+00:00 app[web.1]: npm ERR! react-webpack-setup@1.0.0 start: `webpack-dev-server`
    2018-05-29T13:18:00.274665+00:00 app[web.1]: npm ERR! spawn ENOENT
    2018-05-29T13:18:00.275002+00:00 app[web.1]: npm ERR!
    2018-05-29T13:18:00.275263+00:00 app[web.1]: npm ERR! Failed at the react-webpack-setup@1.0.0 start script.
    2018-05-29T13:18:00.275520+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    2018-05-29T13:18:00.286124+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
    2018-05-29T13:18:00.286257+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-05-29T13_18_00_277Z-debug.log
    2018-05-29T13:18:00.285904+00:00 app[web.1]: 
    2018-05-29T13:19:15.000000+00:00 app[api]: Build started by user reena_verma@hotmail.com
    2018-05-29T13:20:10.047861+00:00 heroku[web.1]: State changed from crashed to starting
    2018-05-29T13:20:09.687189+00:00 app[api]: Release v6 created by user 
    reena_verma@hotmail.com
2018-05-29T13:20:09.687189+00:00 app[api]: Deploy 0ccd4f16 by user 
    reena_verma@hotmail.com
    2018-05-29T13:20:09.000000+00:00 app[api]: Build succeeded
    2018-05-29T13:20:16.565903+00:00 heroku[web.1]: Starting process with command `npm start`
     2018-05-29T13:20:18.676323+00:00 app[web.1]: 
    2018-05-29T13:20:18.676361+00:00 app[web.1]: > react-webpack-setup@1.0.0 start /app
    2018-05-29T13:20:18.676363+00:00 app[web.1]: > webpack-dev-server
    2018-05-29T13:20:18.676364+00:00 app[web.1]: 
    2018-05-29T13:20:20.167148+00:00 app[web.1]: webpack output is served from /
    2018-05-29T13:20:20.167212+00:00 app[web.1]: Content not from webpack is served from src
    2018-05-29T13:20:20.222367+00:00 app[web.1]: Unable to open browser. If you are running in a headless environment, please do not use the open flag.
    2018-05-29T13:20:20.167258+00:00 app[web.1]: 404s will fallback to /index.html
    2018-05-29T13:20:20.166932+00:00 app[web.1]: Project is running at http://localhost:8000/
    2018-05-29T13:20:23.809465+00:00 app[web.1]: Hash: 13feeba3b007d3242808
    2018-05-29T13:20:23.809481+00:00 app[web.1]: Version: webpack 3.11.0
    2018-05-29T13:20:23.809483+00:00 app[web.1]: Time: 3726ms
    2018-05-29T13:20:23.809486+00:00 app[web.1]: Asset       Size  Chunks                    Chunk Names
    2018-05-29T13:20:23.809487+00:00 app[web.1]: app.js    1.11 MB       0  [emitted]  [big]  main
    2018-05-29T13:20:23.809489+00:00 app[web.1]: index.html  204 bytes          [emitted]
    2018-05-29T13:20:23.809491+00:00 app[web.1]: assets/scss/main.scss  301 bytes          [emitted]
    2018-05-29T13:20:23.809492+00:00 app[web.1]: assets/scss/components/body.scss  198 bytes          [emitted]
    2018-05-29T13:20:23.809494+00:00 app[web.1]: assets/scss/components/form.scss    1.47 kB          [emitted]
    2018-05-29T13:20:23.809495+00:00 app[web.1]: assets/scss/components/progress-bar.scss  255 bytes          [emitted]
    2018-05-29T13:20:23.809497+00:00 app[web.1]: assets/scss/components/typography.scss   92 bytes          [emitted]
    2018-05-29T13:20:23.809499+00:00 app[web.1]: assets/.gitkeep    0 bytes          [emitted]
    2018-05-29T13:20:23.809501+00:00 app[web.1]: [2] ./node_modules/react/index.js 190 bytes {0} [built]
    2018-05-29T13:20:23.809502+00:00 app[web.1]: [5] (webpack)/hot/log.js 1.04 kB {0} [built]
    2018-05-29T13:20:23.809504+00:00 app[web.1]: [11] (webpack)/hot/emitter.js 77 bytes {0} [built]
    2018-05-29T13:20:23.809506+00:00 app[web.1]: [20] multi (webpack)-dev-server/client?http://localhost:8000 webpack/hot/dev-server ./src/app.js 52 bytes {0} [built]
    2018-05-29T13:20:23.809507+00:00 app[web.1]: [21] (webpack)-dev-server/client?http://localhost:8000 7.93 kB {0} [built]
    2018-05-29T13:20:23.809508+00:00 app[web.1]: [22] ./node_modules/url/url.js 23.3 kB {0} [built]
    2018-05-29T13:20:23.809510+00:00 app[web.1]: [32] (webpack)-dev-server/client/socket.js 1.08 kB {0} [built]
    2018-05-29T13:20:23.809511+00:00 app[web.1]: [34] (webpack)-dev- 
 server/client/overlay.js 3.67 kB {0} [built]
    2018-05-29T13:20:23.809512+00:00 app[web.1]: [39] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {0} [built]
    2018-05-29T13:20:23.809513+00:00 app[web.1]: [41] (webpack)/hot/dev-server.js 1.61 kB {0} [built]
    2018-05-29T13:20:23.809514+00:00 app[web.1]: [42] (webpack)/hot/log-apply-result.js 1.31 kB {0} [built]
    2018-05-29T13:20:23.809516+00:00 app[web.1]: [43] ./src/app.js 5.48 kB {0} [built]
    2018-05-29T13:20:23.809517+00:00 app[web.1]: [47] ./node_modules/react-dom/index.js 1.36 kB {0} [built]
    2018-05-29T13:20:23.809518+00:00 app[web.1]: [56] ./src/components/ProgressBar.js 835 bytes {0} [built]
    2018-05-29T13:20:23.809519+00:00 app[web.1]: [60] ./src/components/Form.js 6.03 kB {0} [built]
    2018-05-29T13:20:23.809520+00:00 app[web.1]: + 46 hidden modules
    2018-05-29T13:20:23.809522+00:00 app[web.1]: Child html-webpack-plugin for "index.html":
    2018-05-29T13:20:23.809523+00:00 app[web.1]: 1 asset
    2018-05-29T13:20:23.809525+00:00 app[web.1]: [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 553 bytes {0} [built]
    2018-05-29T13:20:23.809526+00:00 app[web.1]: [1] ./node_modules/html-webpack-plugin/node_modules/lodash/lodash.js 540 kB {0} [built]
    2018-05-29T13:20:23.809527+00:00 app[web.1]: [2] (webpack)/buildin/global.js 509 bytes {0} [built]
    2018-05-29T13:20:23.809528+00:00 app[web.1]: [3] (webpack)/buildin/module.js 517 bytes {0} [built]
    2018-05-29T13:20:23.809534+00:00 app[web.1]: webpack: Compiled successfully.
    2018-05-29T13:21:17.346647+00:00 heroku[web.1]: State changed from starting to crashed
    2018-05-29T13:21:17.217415+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
   2018-05-29T13:21:17.217544+00:00 heroku[web.1]: Stopping process with SIGKILL
    2018-05-29T13:21:17.327732+00:00 heroku[web.1]: Process exited with status 137

1 Ответ

0 голосов
/ 29 мая 2018

Проблема в том, что вы используете webpack-dev-server для запуска проекта.Этот пакет определен в devDependencies в вашем package.json , что означает, что при развертывании на heroku, он (heroku) запустит сборку для производства, что означает, что все devDependencies не будут включены и, следовательно, ошибка

sh: 1: webpack-dev-server: не найдено

Так что если вы действительно хотите запустить dev-сервер в производственной среде, включите webpack-dev-сервер в разделе зависимостей вашего файла пакета, в отличие от devDependencies.

Если нет, то, что я бы предложил, тогда следуйте по this .Он расскажет вам, как подготовить вашу среду к развертыванию на герою для производства.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...