Кто-нибудь понимает, почему моя сборка Heroku не работает? - PullRequest
0 голосов
/ 18 февраля 2020

Я могу вывести sh Героку. Когда я запускаю heroku open, на странице браузера появляется ошибка приложения. Это говорит о том, что я запускаю heroku logs --tail, что я и сделал, и в своем CLI я получаю следующее:

2020-02-18T13:38:17.617747+00:00 app[api]: Release v2 created by user myemail@gmail.com
2020-02-18T13:38:17.617747+00:00 app[api]: Enable Logplex by user myemail@gmail.com
2020-02-18T13:38:16.539707+00:00 app[api]: Initial release by user myemail@gmail.com
2020-02-18T13:38:16.539707+00:00 app[api]: Release v1 created by user myemail@gmail.com
2020-02-18T13:39:28.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:39:29.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/b161fc9c-34f9-4258-8f6a-c8cf73016f74
2020-02-18T13:40:39.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:40:40.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/6a2ef41e-da40-4b22-9f44-dfc558e3f8c6
2020-02-18T13:41:55.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:41:56.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/7e98abc0-c073-40bd-bdcd-3e3c1960a1d4
2020-02-18T13:42:06.962017+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=event-finder-au.herokuapp.com request_id=447e958f-de6c-40d4-bee4-8d3d61531a72 fwd="86.7.194.99" dyno= connect= service= status=502 bytes= protocol=https
2020-02-18T13:42:07.345863+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=event-finder-au.herokuapp.com request_id=227ffbed-06eb-4120-8e6a-c8ceded83237 fwd="86.7.194.99" dyno= connect= service= status=502 bytes= protocol=https
2020-02-18T13:48:08.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:48:09.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/851460c8-5acc-4547-89b0-723b2cb0070b
2020-02-18T13:48:42.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:48:43.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/bb02d5f6-b034-476f-8855-ad5173bedfa4
2020-02-18T13:51:22.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:51:23.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/7c1b17e9-27b2-4169-9a6b-c33a7593a20d
2020-02-18T13:55:45.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:55:46.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/caf2422c-28bd-4362-9a00-40a1e8a4bef9
2020-02-18T13:56:58.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:56:59.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/44aabc7b-81a4-45c8-95ab-3ba0b0b98cb2
2020-02-18T13:59:22.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T13:59:24.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/6e917697-398f-46ca-89e7-a127db05608e
2020-02-18T14:00:58.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T14:01:00.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/bf2be350-233f-4320-ab4e-034b13bb6a9d
2020-02-18T14:01:19.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T14:01:20.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/fdcfdeca-6786-4e3a-82b5-3ed6ee7a5517/activity/builds/42aba518-a40c-4f50-b4c5-839aecdeeb35
2020-02-18T14:02:44.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T14:03:40.379721+00:00 app[api]: Deploy 2daf4356 by user myemail@gmail.com
2020-02-18T14:03:40.379721+00:00 app[api]: Release v3 created by user myemail@gmail.com
2020-02-18T14:03:40.400674+00:00 app[api]: Scaled to web@1:Free by user myemail@gmail.com
2020-02-18T14:03:45.330569+00:00 heroku[web.1]: Starting process with command `npm start`
2020-02-18T14:03:45.000000+00:00 app[api]: Build succeeded
2020-02-18T14:03:50.190387+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-18T14:03:50.195889+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-18T14:03:50.173709+00:00 heroku[web.1]: Process exited with status 1
2020-02-18T14:03:50.033183+00:00 app[web.1]: npm ERR! missing script: start
2020-02-18T14:03:50.058454+00:00 app[web.1]: 
2020-02-18T14:03:50.058836+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-02-18T14:03:50.058991+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-02-18T14_03_50_034Z-debug.log
2020-02-18T14:03:53.954752+00:00 heroku[web.1]: Starting process with command `npm start`
2020-02-18T14:03:56.614988+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-18T14:03:56.600007+00:00 heroku[web.1]: Process exited with status 1
2020-02-18T14:03:56.523382+00:00 app[web.1]: npm ERR! missing script: start
2020-02-18T14:03:56.536675+00:00 app[web.1]: 
2020-02-18T14:03:56.537274+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-02-18T14:03:56.537588+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-02-18T14_03_56_524Z-debug.log
2020-02-18T14:03:58.167610+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=event-finder-au.herokuapp.com request_id=6461804e-4804-4ce0-91b0-314ba1d0a0b4 fwd="86.7.194.99" dyno= connect= service= status=503 bytes= protocol=https
2020-02-18T14:03:58.671517+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=event-finder-au.herokuapp.com request_id=0072ed32-b9ad-4205-a3e0-111a4b57eb45 fwd="86.7.194.99" dyno= connect= service= status=503 bytes= protocol=https
2020-02-18T14:05:11.000000+00:00 app[api]: Build started by user myemail@gmail.com
2020-02-18T14:05:49.857750+00:00 heroku[web.1]: State changed from crashed to starting
2020-02-18T14:05:49.660236+00:00 app[api]: Deploy 6b00eac2 by user myemail@gmail.com
2020-02-18T14:05:49.660236+00:00 app[api]: Release v4 created by user myemail@gmail.com
2020-02-18T14:05:53.023230+00:00 heroku[web.1]: Starting process with command `npm start`
2020-02-18T14:05:55.615774+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-18T14:05:55.540224+00:00 app[web.1]: npm ERR! missing script: start
2020-02-18T14:05:55.549366+00:00 app[web.1]: 
2020-02-18T14:05:55.549975+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-02-18T14:05:55.550306+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-02-18T14_05_55_541Z-debug.log
2020-02-18T14:05:55.602183+00:00 heroku[web.1]: Process exited with status 1
2020-02-18T14:05:54.000000+00:00 app[api]: Build succeeded
2020-02-18T14:06:01.546305+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=event-finder-au.herokuapp.com request_id=3bc8dfc5-a6f2-436f-bcf2-9fbb2dc54e5c fwd="86.7.194.99" dyno= connect= service= status=503 bytes= protocol=https
2020-02-18T14:06:01.850676+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=event-finder-au.herokuapp.com request_id=6736e715-66e8-4cc7-9425-6a1f45307230 fwd="86.7.194.99" dyno= connect= service= status=503 bytes= protocol=https

Я начинающий, когда дело доходит до такого рода вещей, поэтому у меня буквально нет Идея, что все это значит.

Мой пакет. json выглядит так, если поможет -

{
  "name": "basic-react-webpack-setup",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "serve": "webpack-dev-server --mode=development"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/preset-env": "^7.2.3",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.5",
    "css-loader": "^2.1.0",
    "html-webpack-plugin": "^3.2.0",
    "node-sass": "^4.13.1",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.2.1",
    "webpack-dev-server": "^3.9.0"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "bulma": "^0.8.0",
    "child_process": "^1.0.2",
    "cluster": "^0.7.7",
    "file": "^0.2.2",
    "lib": "^4.0.5",
    "loader": "^2.1.1",
    "moment": "^2.24.0",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-map-gl": "^5.1.3",
    "react-router-dom": "^5.1.2",
    "url": "^0.11.0"
  }
}

Ответы [ 2 ]

1 голос
/ 19 февраля 2020

Важной частью этого вывода является следующее:

npm ERR! missing script: start

Heroku необходимо знать, как запустить ваше приложение. Вы можете предоставить Procfile с соответствующей командой, например,

web: node server.js

, или вы можете добавить сценарий start к своему package.json, так как Heroku по умолчанию запускает его в отсутствие Procfile для JavaScript проектов:

"scripts": {
  "test": "echo \"Error: no test specified\" && exit 1",
  "serve": "webpack-dev-server --mode=development",
  "start" "node server.js"
},

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

0 голосов
/ 29 февраля 2020

Вы можете попробовать добавить следующее в ваш пакет. json file:

"start": "if-env NODE_ENV=production 
&& npm run start:prod || npm run 
 start:dev", 
"start:prod": "node server.js", 
"start:dev": "concurrently \"nodemon - 
-ignore 'client/*'\" \"npm run 
client\"",

Было бы также приятно увидеть файл вашего сервера

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