Not a duplicate of Application Error when I deploy to heroku as they were missing a file.
Not a duplicate of Heroku Application Error When Deploying to Heroku which was a problem for a Ruby app.
Expected Result
I should be able to see my blog (built with Gatsby) deployed to heroku at its url at http://vllg.herokuapp.com/
Actual Result
The page shows an error which instructs me to check my logs, below is the result.
LOGS
2019-03-13T21:41:28.488417+00:00 app[web.1]: success createPages — 0.066 s
2019-03-13T21:41:28.539587+00:00 app[web.1]: success createPagesStatefully — 0.051 s
2019-03-13T21:41:28.542875+00:00 app[web.1]: success onPreExtractQueries — 0.003 s
2019-03-13T21:41:28.856797+00:00 app[web.1]: success update schema — 0.314 s
2019-03-13T21:41:28.917320+00:00 app[web.1]: warning Using the global `graphql` tag is deprecated, and will not be supported in v3.
2019-03-13T21:41:28.917324+00:00 app[web.1]: Import it instead like: import { graphql } from 'gatsby' in file:
2019-03-13T21:41:28.917326+00:00 app[web.1]: /app/src/pages/blog.js
2019-03-13T21:41:28.999695+00:00 app[web.1]: success extract queries from components — 0.143 s
2019-03-13T21:41:29.155426+00:00 app[web.1]: success run graphql queries — 0.156 s — 10/10 64.94 queries/second
2019-03-13T21:41:29.159995+00:00 app[web.1]: success write out page data — 0.004 s
2019-03-13T21:41:29.160825+00:00 app[web.1]: success write out redirect data — 0.001 s
2019-03-13T21:41:29.362576+00:00 app[web.1]: done generating icons for manifest
2019-03-13T21:41:29.363187+00:00 app[web.1]: success onPostBootstrap — 0.202 s
2019-03-13T21:41:29.363362+00:00 app[web.1]:
2019-03-13T21:41:29.363506+00:00 app[web.1]: info bootstrap finished - 6.089 s
2019-03-13T21:41:29.363561+00:00 app[web.1]:
2019-03-13T21:41:35.474922+00:00 app[web.1]: DONE Compiled successfully in 4713ms9:41:35 PM
2019-03-13T21:41:35.475029+00:00 app[web.1]:
2019-03-13T21:41:35.488519+00:00 app[web.1]:
2019-03-13T21:41:35.488812+00:00 app[web.1]: You can now view vllg in the browser.
2019-03-13T21:41:35.488882+00:00 app[web.1]:
2019-03-13T21:41:35.488935+00:00 app[web.1]: http://localhost:8000/
2019-03-13T21:41:35.489000+00:00 app[web.1]:
2019-03-13T21:41:35.489074+00:00 app[web.1]: View GraphiQL, an in-browser IDE, to explore your site's data and schema
2019-03-13T21:41:35.489139+00:00 app[web.1]:
2019-03-13T21:41:35.489197+00:00 app[web.1]: http://localhost:8000/___graphql
2019-03-13T21:41:35.489246+00:00 app[web.1]:
2019-03-13T21:41:35.489329+00:00 app[web.1]: Note that the development build is not optimized.
2019-03-13T21:41:35.489406+00:00 app[web.1]: To create a production build, use npm run build
2019-03-13T21:41:35.489460+00:00 app[web.1]:
2019-03-13T21:41:35.518813+00:00 app[web.1]: ℹ 「wdm」:
2019-03-13T21:41:35.518919+00:00 app[web.1]: ℹ 「wdm」: Compiled successfully.
2019-03-13T21:42:21.505858+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-03-13T21:42:21.505911+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-03-13T21:42:21.660871+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-13T21:42:21.643794+00:00 heroku[web.1]: Process exited with status 137
2019-03-14T03:25:18.012932+00:00 heroku[web.1]: State changed from crashed to starting
2019-03-14T03:25:26.974905+00:00 heroku[web.1]: Starting process with command `npm start`
2019-03-14T03:25:29.221439+00:00 app[web.1]:
2019-03-14T03:25:29.221465+00:00 app[web.1]: > vllg#0.1.0 start /app
2019-03-14T03:25:29.221467+00:00 app[web.1]: > npm run develop
2019-03-14T03:25:29.221469+00:00 app[web.1]:
2019-03-14T03:25:29.642388+00:00 app[web.1]:
2019-03-14T03:25:29.642437+00:00 app[web.1]: > vllg#0.1.0 develop /app
2019-03-14T03:25:29.642951+00:00 app[web.1]: > gatsby develop
2019-03-14T03:25:29.642954+00:00 app[web.1]:
2019-03-14T03:25:34.179104+00:00 app[web.1]: lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory
2019-03-14T03:25:34.371576+00:00 app[web.1]: success open and validate gatsby-configs — 0.018 s
2019-03-14T03:25:35.101757+00:00 app[web.1]: success load plugins — 0.729 s
2019-03-14T03:25:36.254992+00:00 app[web.1]: success onPreInit — 1.153 s
2019-03-14T03:25:36.301769+00:00 app[web.1]: success delete html and css files from previous builds — 0.047 s
2019-03-14T03:25:36.341230+00:00 app[web.1]: success initialize cache — 0.039 s
2019-03-14T03:25:36.394596+00:00 app[web.1]: success copy gatsby files — 0.053 s
2019-03-14T03:25:36.405920+00:00 app[web.1]: success onPreBootstrap — 0.011 s
2019-03-14T03:25:36.570578+00:00 app[web.1]: success source and transform nodes — 0.165 s
2019-03-14T03:25:37.534865+00:00 app[web.1]: success building schema — 0.964 s
2019-03-14T03:25:37.682403+00:00 app[web.1]: success createPages — 0.145 s
2019-03-14T03:25:37.846729+00:00 app[web.1]: success createPagesStatefully — 0.164 s
2019-03-14T03:25:37.856984+00:00 app[web.1]: success onPreExtractQueries — 0.010 s
2019-03-14T03:25:38.258545+00:00 app[web.1]: success update schema — 0.401 s
2019-03-14T03:25:38.381310+00:00 app[web.1]: warning Using the global `graphql` tag is deprecated, and will not be supported in v3.
2019-03-14T03:25:38.381315+00:00 app[web.1]: Import it instead like: import { graphql } from 'gatsby' in file:
2019-03-14T03:25:38.381317+00:00 app[web.1]: /app/src/pages/blog.js
2019-03-14T03:25:38.546084+00:00 app[web.1]: success extract queries from components — 0.287 s
2019-03-14T03:25:38.877403+00:00 app[web.1]: success run graphql queries — 0.331 s — 10/10 30.74 queries/second
2019-03-14T03:25:38.888429+00:00 app[web.1]: success write out page data — 0.011 s
2019-03-14T03:25:38.889427+00:00 app[web.1]: success write out redirect data — 0.001 s
2019-03-14T03:25:39.394941+00:00 app[web.1]: done generating icons for manifest
2019-03-14T03:25:39.397600+00:00 app[web.1]: success onPostBootstrap — 0.508 s
2019-03-14T03:25:39.398607+00:00 app[web.1]:
2019-03-14T03:25:39.399205+00:00 app[web.1]: info bootstrap finished - 9.734 s
2019-03-14T03:25:39.399508+00:00 app[web.1]:
2019-03-14T03:25:49.598021+00:00 app[web.1]: DONE Compiled successfully in 7982ms3:25:49 AM
2019-03-14T03:25:49.598123+00:00 app[web.1]:
2019-03-14T03:25:49.668957+00:00 app[web.1]:
2019-03-14T03:25:49.669051+00:00 app[web.1]: You can now view vllg in the browser.
2019-03-14T03:25:49.669113+00:00 app[web.1]:
2019-03-14T03:25:49.669181+00:00 app[web.1]: http://localhost:8000/
2019-03-14T03:25:49.669263+00:00 app[web.1]:
2019-03-14T03:25:49.669509+00:00 app[web.1]: View GraphiQL, an in-browser IDE, to explore your site's data and schema
2019-03-14T03:25:49.669573+00:00 app[web.1]:
2019-03-14T03:25:49.669642+00:00 app[web.1]: http://localhost:8000/___graphql
2019-03-14T03:25:49.669711+00:00 app[web.1]:
2019-03-14T03:25:49.669766+00:00 app[web.1]: Note that the development build is not optimized.
2019-03-14T03:25:49.669875+00:00 app[web.1]: To create a production build, use npm run build
2019-03-14T03:25:49.669941+00:00 app[web.1]:
2019-03-14T03:25:49.809865+00:00 app[web.1]: ℹ 「wdm」:
2019-03-14T03:25:49.810002+00:00 app[web.1]: ℹ 「wdm」: Compiled successfully.
2019-03-14T03:26:27.415495+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-03-14T03:26:27.415791+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-03-14T03:26:27.640591+00:00 heroku[web.1]: Process exited with status 137
2019-03-14T03:26:27.669848+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-14T06:29:40.584512+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vllg.herokuapp.com request_id=05381bb0-3b5e-4191-b20f-bd1a0ab788fe fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:29:40.995063+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vllg.herokuapp.com request_id=69bc54f5-3ffc-469c-8919-7f46eef7ed3f fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:31:47.930409+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vllg.herokuapp.com request_id=53dd38e4-9b34-41fe-8838-2ce2f659ddc0 fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:31:48.205331+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vllg.herokuapp.com request_id=140a8ca7-0a44-4a91-83f7-9726a1c1a94b fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:50:31.151053+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vllg.herokuapp.com request_id=4aef2e8c-d00e-4fc6-9d72-f05fe676a7b1 fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:50:31.476418+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vllg.herokuapp.com request_id=af2c772d-3299-4767-8c7b-e2fa0de414ab fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:52:49.412131+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vllg.herokuapp.com request_id=84f885b2-a2d7-42c5-a4ff-8b9f2d692c39 fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
2019-03-14T06:52:49.675993+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vllg.herokuapp.com request_id=23679509-eff5-46c2-86e6-1971c91dc368 fwd="98.164.218.149" dyno= connect= service= status=503 bytes= protocol=http
Repo
My code repository is available to browse at https://github.com/JGallardo/vllg
Attempted solutions and research
I found a similar issue of status 137 at Heroku "Process exited with status 137" node.js app but not sure how to apply anything there to my project
I see an error about needing to build a production build? that was not in the instructions by heroku in the tutorial that i followed but i ran npm run build and don't see a new build folder.
I also see that there is a R 10 error, i found a similar issue mentioned in Heroku Boot Timeout (Error R10) but that seems to perhaps be a python project as I think a Procfile is only for Ruby projects?
I haven't used Heroku before but I can give you some guidance perhaps looking at your logs.
gatsby develop is supposed to be a development command only for when your testing the site so it looks like it's having a conflict, though you shouldn't be using that command anyways as it should be built with gatsby build. Using Gatsby develop also does not provide an optimized version of your site so your missing out on many of the benefits.
That said gatsby build creates a public folder in your directory with static assets. For testing locally you should use gatsby serve to properly view the build and make sure it works as expected. For Heroku you shouldn't have to use the serve command you should be able to just give it your static assets in the public folder.
You can also "teach" Heroku how to build for you following this guide. https://www.gatsbyjs.org/docs/deploying-to-heroku/
Can also confirm Netlify is awesome for static sites and Gatsby.
The error message says Web process failed to bind to $PORT within 60 seconds of launch.
Heroku randomly assigns a port and sets into variable $PORT.
If it doesn't find anything using that port for 60 seconds, app crashes.
The easiest option is to create a Procfile
and add something like web: gatsby serve -p $PORT -H 0.0.0.0
, which runs app in given env. variable.
Heroku is more useful for server-side apps. With the command build, Gatsby provides you a static version of your blog. This way, you can upload it on a CDN, it's way more performant. I would advise Netlify:
It's free
It's based on your GitHub account
It automatically deploys new changes (via git commit hooks)
You can even use a custom domain
Related
Error
2021-01-19T05:38:29.490890+00:00 app[web.1]: > MIT-Ask#1.0.0 start
2021-01-19T05:38:29.490895+00:00 app[web.1]: > nodemon --ignore client/ node index.js
2021-01-19T05:38:29.490895+00:00 app[web.1]:
2021-01-19T05:38:30.619237+00:00 app[web.1]: [33m[nodemon] 2.0.6[39m
2021-01-19T05:38:30.620714+00:00 app[web.1]: [33m[nodemon] to restart at any time, enter `rs`[39m
2021-01-19T05:38:30.621395+00:00 app[web.1]: [33m[nodemon] watching path(s): *.*[39m
2021-01-19T05:38:30.621500+00:00 app[web.1]: [33m[nodemon] watching extensions: js,mjs,json[39m
2021-01-19T05:38:30.622155+00:00 app[web.1]: [32m[nodemon] starting `node node index.js server/server.js`[39m
2021-01-19T05:38:33.899415+00:00 app[web.1]: node:internal/modules/cjs/loader:928
2021-01-19T05:38:33.899424+00:00 app[web.1]: throw err;
2021-01-19T05:38:33.899425+00:00 app[web.1]: ^
2021-01-19T05:38:33.899425+00:00 app[web.1]:
2021-01-19T05:38:33.899426+00:00 app[web.1]: Error: Cannot find module 'webpack'
2021-01-19T05:38:33.899426+00:00 app[web.1]: Require stack:
2021-01-19T05:38:33.899427+00:00 app[web.1]: - /app/webpack.config.js
2021-01-19T05:38:33.899427+00:00 app[web.1]: - /app/server/api.js
2021-01-19T05:38:33.899428+00:00 app[web.1]: - /app/server/server.js
2021-01-19T05:38:33.899429+00:00 app[web.1]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
2021-01-19T05:38:33.899429+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:769:27)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:997:19)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:92:18)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at Object.<anonymous> (/app/webpack.config.js:23:17)
2021-01-19T05:38:33.899431+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1108:14)
2021-01-19T05:38:33.899431+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
2021-01-19T05:38:33.899432+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:973:32)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:813:14)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:997:19)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:92:18)
2021-01-19T05:38:33.899434+00:00 app[web.1]: at Object.<anonymous> (/app/server/api.js:55:21)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1108:14)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:973:32)
2021-01-19T05:38:33.899436+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
2021-01-19T05:38:33.899436+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2021-01-19T05:38:33.899437+00:00 app[web.1]: requireStack: [
2021-01-19T05:38:33.899437+00:00 app[web.1]: '/app/webpack.config.js',
2021-01-19T05:38:33.899437+00:00 app[web.1]: '/app/server/api.js',
2021-01-19T05:38:33.899438+00:00 app[web.1]: '/app/server/server.js'
2021-01-19T05:38:33.899438+00:00 app[web.1]: ]
2021-01-19T05:38:33.899438+00:00 app[web.1]: }
2021-01-19T05:38:33.914301+00:00 app[web.1]: [31m[nodemon] app crashed - waiting for file changes before starting...[39m
2021-01-19T05:39:25.752043+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-01-19T05:39:25.778172+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-01-19T05:39:25.939029+00:00 heroku[web.1]: Process exited with status 137
2021-01-19T05:39:25.986786+00:00 heroku[web.1]: State changed from starting to crashed
2021-01-19T05:39:29.247585+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mit-ask.herokuapp.com request_id=80c88480-df28-495a-9caf-dac6cd348f3b fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
2021-01-19T05:39:29.667520+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mit-ask.herokuapp.com request_id=38dc7bc6-c389-4e27-bd13-da8e20804b4f fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
2021-01-19T05:39:29.971285+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mit-ask.herokuapp.com request_id=f241cef6-8ff4-49df-baff-97d9818c9228 fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
I have looked up many of the solutions and reinstalled webpack. When I start up the app in vscode myself, everything works fine. Commands npm start and npm run hotloader both start up the server and the actual app fine. When I deploy it, it says successful but when I try to load the site, it gives the above error.
In my server.js file, I have const port = process.env.PORT || 3000, but it's still giving me the Web process failed to bind to $PORT within 60 seconds of launch error. I'm not sure what's wrong here.
On another platform, someone was able to successfully help me with this.
They said that it fails to bind to the port cause the server failed to start. Heroku deletes devDependencies after the first build, so webpack is probably deleted by the time the server starts.
The issue was that I was importing webpack in my api.js that wasn't necessary. After deleting that, the Heroku app deployed fine.
i have created a react ecom app with shopify api, app works locally and build was successfully deployed but i cannot view my app online. here is my github repo https://github.com/lizhavird/shopify-react-app
here is my heroku log:
2020-07-01T10:29:56.615981+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-01T10:30:07.175132+00:00 heroku[web.1]: Starting process with command `node ./src/index.js`
2020-07-01T10:30:08.919146+00:00 app[web.1]: /app/src/index.js:1
2020-07-01T10:30:08.919158+00:00 app[web.1]: import React from 'react';
2020-07-01T10:30:08.919161+00:00 app[web.1]: ^^^^^
2020-07-01T10:30:08.919162+00:00 app[web.1]:
2020-07-01T10:30:08.919163+00:00 app[web.1]: SyntaxError: Unexpected identifier
2020-07-01T10:30:08.919163+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:721:23)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2020-07-01T10:30:08.919165+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2020-07-01T10:30:08.919165+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
2020-07-01T10:30:08.919166+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2020-07-01T10:30:08.919166+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2020-07-01T10:30:08.948836+00:00 heroku[web.1]: Process exited with status 1
2020-07-01T10:30:08.981678+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-01T10:30:09.000000+00:00 app[api]: Build succeeded
2020-07-01T10:30:31.948773+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shopify-ecom-react-app.herokuapp.com request_id=9ae149f3-e6e5-4b74-bc3f-67bea169f9d2 fwd="23.243.87.63" dyno= connect= service= status=503 bytes= protocol=https
The error tells you the import keyword isn't valid syntax. That's because import is part of the ES Modules feature which isn't available in your Node (v10) version.
The recommended way to deploy Create React Apps to Heroku is to use the CRA Heroku Buildpack.
I made a react application that works with a prisma - graphql server. The server is located inside the react application. I want to deploy it with Heroku (first time ever using it). When I deploy to Heroku I get this error when I run heroku logs --tail
020-06-12T14:10:04.296156+00:00 heroku[web.1]: Process exited with status 0
2020-06-12T14:10:04.332716+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-12T14:10:04.335407+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-12T14:10:15.424387+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-12T14:10:17.947363+00:00 app[web.1]:
2020-06-12T14:10:17.947379+00:00 app[web.1]: > business-scheduler#0.1.0 start /app
2020-06-12T14:10:17.947379+00:00 app[web.1]: > react-scripts start
2020-06-12T14:10:17.947379+00:00 app[web.1]:
2020-06-12T14:10:20.724920+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.19.52.78/
2020-06-12T14:10:20.725386+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-12T14:10:20.725577+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-12T14:10:20.725681+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-12T14:10:20.725971+00:00 app[web.1]: Starting the development server...
2020-06-12T14:10:20.725972+00:00 app[web.1]:
2020-06-12T14:10:20.803624+00:00 heroku[web.1]: Process exited with status 0
2020-06-12T14:10:20.835709+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-12T14:27:07.241917+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=appoint-scheduler.herokuapp.com request_id=4a6d7846-488a-4a57-bd76-ee5b84c197fc fwd="94.227.127.41" dyno= connect= service= status=503 bytes= protocol=https
2020-06-12T14:27:07.688859+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=appoint-scheduler.herokuapp.com request_id=83928da3-bc4a-44f5-83fb-66a7c5b2611d fwd="94.227.127.41" dyno= connect= service= status=503 bytes= protocol=https
I am using yarn not npm on my project does anyone know what I need to do to be able to deploy my project?
Because my project is not running on heroku because I get this when trying to open the deployed version
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
I think the issue is that you're trying to start the react development server on heroku. Your react app should be served as a static js bundle which is generated after you run the production build cmd npm run build.
Have a look at https://github.com/mars/create-react-app-buildpack which is developed for this usecase only and makes it much easier.
If you're trying to deploy the whole stack ( react + prisma + graphql server )...take a look at this post which covers it in detail.
Hope this helps !
This is what I get when I call heroku logs --tail in the command line. I'm trying to figure out how to bind to the PORT environment variable.
- 2017-08-14T20:37:08.596686+00:00 heroku[web.1]: Starting process with command `npm start`
- 2017-08-14T20:37:12.430214+00:00 app[web.1]:
- 2017-08-14T20:37:12.430257+00:00 app[web.1]: > angular-seed#0.0.0 prestart /app
- 2017-08-14T20:37:12.430258+00:00 app[web.1]: > npm install
- 2017-08-14T20:37:12.430258+00:00 app[web.1]:
- 2017-08-14T20:37:15.512607+00:00 app[web.1]:
- 2017-08-14T20:37:15.512635+00:00 app[web.1]: > angular-seed#0.0.0 postinstall /app
- 2017-08-14T20:37:15.512636+00:00 app[web.1]: > bower install
- 2017-08-14T20:37:15.512637+00:00 app[web.1]:
- 2017-08-14T20:37:16.486773+00:00 app[web.1]:
- 2017-08-14T20:37:16.486791+00:00 app[web.1]: > angular-seed#0.0.0 start /app
- 2017-08-14T20:37:16.486792+00:00 app[web.1]: > http-server -a localhost - p 8000 -c-1 ./app
- 2017-08-14T20:37:16.486793+00:00 app[web.1]:
- 2017-08-14T20:37:16.825832+00:00 app[web.1]: Starting up http-server, serving ./app
- 2017-08-14T20:37:16.825845+00:00 app[web.1]: Available on:
- 2017-08-14T20:37:16.826624+00:00 app[web.1]: http://localhost:8000
- 2017-08-14T20:37:16.827943+00:00 app[web.1]: Hit CTRL-C to stop the server
- 2017-08-14T20:37:20.747552+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=portfolio- stacyareas.herokuapp.com request_id=f4146b40-cc31-4ca0-acc8-52e76b0cbd58 fwd="75.101.48.232" dyno= connect= service= status=503 bytes= protocol=https
- 2017-08-14T20:38:08.834223+00:00 app[web.1]: Error waiting for process to terminate: No child processes
- 2017-08-14T20:38:08.948625+00:00 heroku[web.1]: State changed from starting to crashed
- 2017-08-14T20:38:10.473956+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=portfolio- stacyareas.herokuapp.com request_id=9553660d-4199-407b-ab74-712e04940b06 fwd="75.101.48.232" dyno= connect= service= status=503 bytes= protocol=https
This is what I have in my index.js file
var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('pages/index');
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
I have NodeJs application with yeoman, grunt, bower installed. I generatedm angularjs app using yeomen. Local version of application runs with no problem by typing grunt serve. Moreover application was successfully deployed to Heroku by grunt deploy link. When trying to access application on heroku it shows:
Application Error An error occurred in the application and your page
could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
In application log (Heroku dashboard > Activity):
Deployed
Build succeeded
-----> Node.js app detected
-----> Reading application state
package.json...
build directory...
cache directory...
environment variables...
Node engine: >=0.10.0
Npm engine: unspecified
Start mechanism: Procfile
node_modules source: package.json
node_modules cached: true
NPM_CONFIG_PRODUCTION=true
NODE_MODULES_CACHE=true
-----> Installing binaries
Resolving node version >=0.10.0 via semver.io...
Downloading and installing node 0.10.35...
Using default npm version: 1.4.28
-----> Building dependencies
Restoring node modules from cache
Pruning unused dependencies
npm WARN package.json nodejsw3#0.0.0 No repository field.
Installing any new modules
npm WARN package.json nodejsw3#0.0.0 No repository field.
-----> Checking startup method
Found Procfile
-----> Finalizing build
Creating runtime environment
Exporting binary paths
Cleaning npm artifacts
Cleaning previous cache
Caching results for future builds
-----> Build succeeded!
nodejsw3#0.0.0 /tmp/build_9b26539892553ae79f16e539e2f083e0
????????? (empty)
WARNING: Avoid semver ranges starting with '>' in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
-----> Discovering process types
Procfile declares types -> web
-----> Compressing... done, 6.8MB
-----> Launching... done, v9
https://myapp.herokuapp.com/ deployed to Heroku
Project structure:
Log
2015-02-07T17:49:56.504866+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=myapp.herokuapp.com request_id=257d316d-98
d1-4d21-a170-7c27e42b907e fwd="10.10.10.11" dyno= connect= service= status=503
bytes=
2015-02-07T17:49:57.762152+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
f109ba40-e921-486a-a79a-7a7d842705a7 fwd="10.10.10.11" dyno= connect= service=
status=503 bytes=
2015-02-07T17:53:40.155437+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=myapp.herokuapp.com request_id=7e0e784c-0e
76-48b1-ad3e-bbf74b400e31 fwd="10.10.10.11" dyno= connect= service= status=503
bytes=
2015-02-07T17:53:41.454002+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
4d56eacf-5515-48e4-9b5d-34ccc4c4457e fwd="10.10.10.11" dyno= connect= service=
status=503 bytes=
2015-02-07T17:54:20.109125+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=myapp.herokuapp.com request_id=b244e431-81
d6-4f82-a0e0-1e845a45a449 fwd="10.10.10.11" dyno= connect= service= status=503
bytes=
2015-02-07T17:54:21.286203+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=
e2c7d762-a88c-49f6-a15b-e1768e7310d5 fwd="10.10.10.11" dyno= connect= service=
status=503 bytes=
2015-02-07T17:57:14.924093+00:00 heroku[web.1]: State changed from crashed to st
arting
2015-02-07T17:57:16.809601+00:00 heroku[web.1]: Starting process with command `n
ode index.js`
2015-02-07T17:57:18.731681+00:00 app[web.1]: module.js:340
2015-02-07T17:57:18.736235+00:00 app[web.1]: at Function.Module._resolveFile
name (module.js:338:15)
2015-02-07T17:57:18.736237+00:00 app[web.1]: at Function.Module._load (modul
e.js:280:25)
2015-02-07T17:57:18.736241+00:00 app[web.1]: at require (module.js:380:17)
2015-02-07T17:57:18.736243+00:00 app[web.1]: at Object.<anonymous> (/app/ind
ex.js:1:77)
2015-02-07T17:57:18.732015+00:00 app[web.1]: throw err;
2015-02-07T17:57:18.736244+00:00 app[web.1]: at Module._compile (module.js:4
56:26)
2015-02-07T17:57:18.731200+00:00 app[web.1]:
2015-02-07T17:57:18.732021+00:00 app[web.1]: ^
2015-02-07T17:57:18.736232+00:00 app[web.1]: Error: Cannot find module 'express'
2015-02-07T17:57:18.736239+00:00 app[web.1]: at Module.require (module.js:36
4:17)
2015-02-07T17:57:18.736246+00:00 app[web.1]: at Object.Module._extensions..j
s (module.js:474:10)
2015-02-07T17:57:18.736247+00:00 app[web.1]: at Module.load (module.js:356:3
2)
2015-02-07T17:57:18.736249+00:00 app[web.1]: at Function.Module._load (modul
e.js:312:12)
2015-02-07T17:57:18.736251+00:00 app[web.1]: at Function.Module.runMain (mod
ule.js:497:10)
2015-02-07T17:57:19.580364+00:00 heroku[web.1]: Process exited with status 8
2015-02-07T17:57:19.592340+00:00 heroku[web.1]: State changed from starting to c
rashed