Issue deploying a reactjs app to herokuapp online - reactjs

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.

Related

heroku application error at=error code=H10 desc="App crashed" method=GET path="/"

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.

Failed run application in heroku with adonis,next,react app framework

I have problem when deploy my app to heroku, i'm using react,next,adonis for build this app.
My env i put in reveal config vars heroku manually
This is my logs error in heroku tail
2019-08-20T09:26:20.148145+00:00 heroku[web.1]: Starting process with command `npm start`
2019-08-20T09:26:22.364045+00:00 app[web.1]:
2019-08-20T09:26:22.364077+00:00 app[web.1]: > adonis-fullstack-app#4.1.0 start /app
2019-08-20T09:26:22.364079+00:00 app[web.1]: > node server.js --production
2019-08-20T09:26:22.364081+00:00 app[web.1]:
2019-08-20T09:26:22.998945+00:00 app[web.1]:
2019-08-20T09:26:22.998985+00:00 app[web.1]: WARNING: Adonis has detected an unhandled promise rejection, which may
2019-08-20T09:26:22.998988+00:00 app[web.1]: cause undesired behavior in production.
2019-08-20T09:26:22.998991+00:00 app[web.1]: To stop this warning, use catch() on promises or wrap await
2019-08-20T09:26:22.998993+00:00 app[web.1]: calls inside try/catch.
2019-08-20T09:26:22.998995+00:00 app[web.1]:
2019-08-20T09:26:23.003594+00:00 app[web.1]: { Error: ENOENT: no such file or directory, open '/app/.env'
2019-08-20T09:26:23.003598+00:00 app[web.1]: at Object.openSync (fs.js:443:3)
2019-08-20T09:26:23.003600+00:00 app[web.1]: at Object.readFileSync (fs.js:343:35)
2019-08-20T09:26:23.003602+00:00 app[web.1]: at Env.load (/app/node_modules/#adonisjs/framework/src/Env/index.js:110:41)
2019-08-20T09:26:23.003605+00:00 app[web.1]: at new Env (/app/node_modules/#adonisjs/framework/src/Env/index.js:42:22)
2019-08-20T09:26:23.003607+00:00 app[web.1]: at Object.app.singleton [as closure] (/app/node_modules/#adonisjs/framework/providers/AppProvider.js:29:14)
2019-08-20T09:26:23.003610+00:00 app[web.1]: at Ioc._resolveBinding (/app/node_modules/#adonisjs/fold/src/Ioc/index.js:231:68)
2019-08-20T09:26:23.003612+00:00 app[web.1]: at Ioc.use (/app/node_modules/#adonisjs/fold/src/Ioc/index.js:731:19)
2019-08-20T09:26:23.003614+00:00 app[web.1]: at NextProvider.register (/app/node_modules/adonis-nextjs/providers/NextProvider/index.js:38:24)
2019-08-20T09:26:23.003615+00:00 app[web.1]: at _.filter.each (/app/node_modules/#adonisjs/fold/src/Registrar/index.js:128:36)
2019-08-20T09:26:23.003618+00:00 app[web.1]: at arrayEach (/app/node_modules/lodash/lodash.js:516:11) errno: -2, syscall: 'open', code: 'ENOENT', path: '/app/.env' }
2019-08-20T09:26:23.021016+00:00 app[web.1]:
2019-08-20T09:26:23.021021+00:00 app[web.1]: Error: ENOENT: no such file or directory, open '/app/.env'
2019-08-20T09:26:23.021023+00:00 app[web.1]:
2019-08-20T09:26:23.021024+00:00 app[web.1]:
2019-08-20T09:26:23.021026+00:00 app[web.1]: 1 Env.load
2019-08-20T09:26:23.021028+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/src/Env/index.js:110
2019-08-20T09:26:23.021030+00:00 app[web.1]:
2019-08-20T09:26:23.021032+00:00 app[web.1]: 2 new Env
2019-08-20T09:26:23.021035+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/src/Env/index.js:42
2019-08-20T09:26:23.021036+00:00 app[web.1]:
2019-08-20T09:26:23.021039+00:00 app[web.1]: 3 Object.app.singleton [as closure]
2019-08-20T09:26:23.021041+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/providers/AppProvider.js:29
2019-08-20T09:26:23.021043+00:00 app[web.1]:
2019-08-20T09:26:23.021045+00:00 app[web.1]: 4 Ioc._resolveBinding
2019-08-20T09:26:23.021047+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Ioc/index.js:231
2019-08-20T09:26:23.021049+00:00 app[web.1]:
2019-08-20T09:26:23.021051+00:00 app[web.1]: 5 Ioc.use
2019-08-20T09:26:23.021053+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Ioc/index.js:731
2019-08-20T09:26:23.021055+00:00 app[web.1]:
2019-08-20T09:26:23.021057+00:00 app[web.1]: 6 AppProvider.boot
2019-08-20T09:26:23.021059+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/providers/AppProvider.js:337
2019-08-20T09:26:23.021061+00:00 app[web.1]:
2019-08-20T09:26:23.021063+00:00 app[web.1]: 7 _.filter.map
2019-08-20T09:26:23.021065+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Registrar/index.js:147
2019-08-20T09:26:23.021066+00:00 app[web.1]:
2019-08-20T09:26:23.021068+00:00 app[web.1]: 8 arrayMap
2019-08-20T09:26:23.021070+00:00 app[web.1]: /app/node_modules/lodash/lodash.js:639
2019-08-20T09:26:23.021072+00:00 app[web.1]:
2019-08-20T09:26:23.029460+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-08-20T09:26:23.029933+00:00 app[web.1]: npm ERR! errno 1
2019-08-20T09:26:23.031184+00:00 app[web.1]: npm ERR! adonis-fullstack-app#4.1.0 start: `node server.js --production`
2019-08-20T09:26:23.031327+00:00 app[web.1]: npm ERR! Exit status 1
2019-08-20T09:26:23.031582+00:00 app[web.1]: npm ERR!
2019-08-20T09:26:23.031795+00:00 app[web.1]: npm ERR! Failed at the adonis-fullstack-app#4.1.0 start script.
2019-08-20T09:26:23.032063+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-08-20T09:26:23.037560+00:00 app[web.1]:
2019-08-20T09:26:23.037776+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-08-20T09:26:23.037921+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-08-20T09_26_23_033Z-debug.log
2019-08-20T09:26:23.100987+00:00 heroku[web.1]: Process exited with status 1
2019-08-20T09:26:23.118856+00:00 heroku[web.1]: State changed from starting to crashed
2019-08-20T09:26:35.633644+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapp.herokuapp.com request_id=d42ff289-f989-4386-a521-d22a650b44ba fwd="103.87.85.198" dyno= connect= service= status=503 bytes= protocol=https
2019-08-20T09:26:35.979151+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=44d7c31f-3b53-49dd-a6b0-13fa5b113004 fwd="103.87.85.198" dyno= connect= service= status=503 bytes= protocol=https
I already try some solution in another forum but not solved
This is my package json
"scripts": {
"start": "node server.js --production",
"heroku-postbuild": "npm run build",
"test": "node ace test",
"dev": "node server.js",
"build": "next build ./next",
"export": "next export ./next"
},
I already look in another but maybe not same implement with my project, any solution?
Do you have the ENV_SILENT parameter in the heroku variables?
Have a nice day
If .env file is missing, AdonisJs throws an exception by default. However, you turn off the exception as follows
somewhere in your code, you are trying to open the .env file. so generate an error.
You can disable .env file and directly use your system environment variables visit this page for more information

Application Error when attempting to deploy Gatsby site to heroku

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

Got my angularjs app to deploy on heroku but when I go to look on the page it gives me an application error

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

Deploying on Heroku using Node.js application fails

I'm following the book Getting MEAN with Mongo, Express, Angular and Node.js and I'm trying to deploy my application to Heroku. I already did it but can't access the live URL, cause I get an application error. I don't know what is happening and why it didn't work, I followed all the concepts in the book.
Here is the tail log from the cmd
2016-10-11T19:51:45.814527+00:00 heroku[api]: Deploy d98fd8a by filipecosta_10#h
otmail.com
2016-10-11T19:51:45.814527+00:00 heroku[api]: Release v3 created by filipecosta_
10#hotmail.com
2016-10-11T19:51:47.335153+00:00 heroku[slug-compiler]: Slug compilation started
2016-10-11T19:51:47.335158+00:00 heroku[slug-compiler]: Slug compilation finishe
d
2016-10-11T19:51:48.026456+00:00 heroku[web.1]: Starting process with command `n
pm start`
2016-10-11T19:51:50.965855+00:00 app[web.1]:
2016-10-11T19:51:50.965871+00:00 app[web.1]: > loc8r#0.0.0 start /app
2016-10-11T19:51:50.965872+00:00 app[web.1]: > node ./bin/www
2016-10-11T19:51:50.965873+00:00 app[web.1]:
2016-10-11T19:51:51.158696+00:00 app[web.1]: module.js:327
2016-10-11T19:51:51.158699+00:00 app[web.1]: throw err;
2016-10-11T19:51:51.158699+00:00 app[web.1]: ^
2016-10-11T19:51:51.158700+00:00 app[web.1]:
2016-10-11T19:51:51.158701+00:00 app[web.1]: Error: Cannot find module '../contr
ollers/main'
2016-10-11T19:51:51.158702+00:00 app[web.1]: at Function.Module._resolveFile
name (module.js:325:15)
2016-10-11T19:51:51.158703+00:00 app[web.1]: at Function.Module._load (modul
e.js:276:25)
2016-10-11T19:51:51.158703+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:51.158704+00:00 app[web.1]: at require (internal/module.js:
12:17)
2016-10-11T19:51:51.158705+00:00 app[web.1]: at Object.<anonymous> (/app/app
_server/routes/index.js:3:17)
2016-10-11T19:51:51.158705+00:00 app[web.1]: at Module._compile (module.js:4
09:26)
2016-10-11T19:51:51.158706+00:00 app[web.1]: at Object.Module._extensions..j
s (module.js:416:10)
2016-10-11T19:51:51.158706+00:00 app[web.1]: at Module.load (module.js:343:3
2)
2016-10-11T19:51:51.158707+00:00 app[web.1]: at Function.Module._load (modul
e.js:300:12)
2016-10-11T19:51:51.158708+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:51.167422+00:00 app[web.1]:
2016-10-11T19:51:51.174247+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-10-11T19:51:51.173815+00:00 app[web.1]: npm ERR! Linux 3.13.0-95-generic
2016-10-11T19:51:51.174531+00:00 app[web.1]: npm ERR! node v4.5.0
2016-10-11T19:51:51.174888+00:00 app[web.1]: npm ERR! npm v2.15.11
2016-10-11T19:51:51.175128+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-10-11T19:51:51.175398+00:00 app[web.1]: npm ERR! loc8r#0.0.0 start: `node .
/bin/www`
2016-10-11T19:51:51.175544+00:00 app[web.1]: npm ERR! Exit status 1
2016-10-11T19:51:51.175660+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:51.175761+00:00 app[web.1]: npm ERR! Failed at the loc8r#0.0.0
start script 'node ./bin/www'.
2016-10-11T19:51:51.175878+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the loc8r package,
2016-10-11T19:51:51.176070+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-10-11T19:51:51.176164+00:00 app[web.1]: npm ERR! node ./bin/www
2016-10-11T19:51:51.176253+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-10-11T19:51:51.175977+00:00 app[web.1]: npm ERR! not with npm itself.
2016-10-11T19:51:51.176393+00:00 app[web.1]: npm ERR! npm bugs loc8r
2016-10-11T19:51:51.176495+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-10-11T19:51:51.176593+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:51.176685+00:00 app[web.1]: npm ERR! npm owner ls loc8r
2016-10-11T19:51:51.176781+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-10-11T19:51:51.180051+00:00 app[web.1]:
2016-10-11T19:51:51.180327+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-10-11T19:51:51.180221+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-10-11T19:51:51.279651+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-10-11T19:51:51.280869+00:00 heroku[web.1]: State changed from crashed to st
arting
2016-10-11T19:51:51.268892+00:00 heroku[web.1]: Process exited with status 1
2016-10-11T19:51:52.894691+00:00 heroku[web.1]: Starting process with command `n
pm start`
2016-10-11T19:51:55.200670+00:00 app[web.1]:
2016-10-11T19:51:55.200685+00:00 app[web.1]: > loc8r#0.0.0 start /app
2016-10-11T19:51:55.200685+00:00 app[web.1]: > node ./bin/www
2016-10-11T19:51:55.200686+00:00 app[web.1]:
2016-10-11T19:51:55.471950+00:00 app[web.1]: module.js:327
2016-10-11T19:51:55.471963+00:00 app[web.1]: throw err;
2016-10-11T19:51:55.471963+00:00 app[web.1]: ^
2016-10-11T19:51:55.471967+00:00 app[web.1]:
2016-10-11T19:51:55.471967+00:00 app[web.1]: Error: Cannot find module '../contr
ollers/main'
2016-10-11T19:51:55.471968+00:00 app[web.1]: at Function.Module._resolveFile
name (module.js:325:15)
2016-10-11T19:51:55.471968+00:00 app[web.1]: at Function.Module._load (modul
e.js:276:25)
2016-10-11T19:51:55.471969+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:55.471969+00:00 app[web.1]: at require (internal/module.js:
12:17)
2016-10-11T19:51:55.471970+00:00 app[web.1]: at Object.<anonymous> (/app/app
_server/routes/index.js:3:17)
2016-10-11T19:51:55.471971+00:00 app[web.1]: at Module._compile (module.js:4
09:26)
2016-10-11T19:51:55.471971+00:00 app[web.1]: at Object.Module._extensions..j
s (module.js:416:10)
2016-10-11T19:51:55.471972+00:00 app[web.1]: at Module.load (module.js:343:3
2)
2016-10-11T19:51:55.471972+00:00 app[web.1]: at Function.Module._load (modul
e.js:300:12)
2016-10-11T19:51:55.471973+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:55.481097+00:00 app[web.1]:
2016-10-11T19:51:55.487850+00:00 app[web.1]: npm ERR! Linux 3.13.0-95-generic
2016-10-11T19:51:55.488249+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-10-11T19:51:55.489769+00:00 app[web.1]: npm ERR! node v4.5.0
2016-10-11T19:51:55.489771+00:00 app[web.1]: npm ERR! npm v2.15.11
2016-10-11T19:51:55.489771+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-10-11T19:51:55.489772+00:00 app[web.1]: npm ERR! loc8r#0.0.0 start: `node .
/bin/www`
2016-10-11T19:51:55.489773+00:00 app[web.1]: npm ERR! Exit status 1
2016-10-11T19:51:55.489897+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:55.490059+00:00 app[web.1]: npm ERR! Failed at the loc8r#0.0.0
start script 'node ./bin/www'.
2016-10-11T19:51:55.490228+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the loc8r package,
2016-10-11T19:51:55.490384+00:00 app[web.1]: npm ERR! not with npm itself.
2016-10-11T19:51:55.490534+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-10-11T19:51:55.490692+00:00 app[web.1]: npm ERR! node ./bin/www
2016-10-11T19:51:55.490844+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-10-11T19:51:55.491004+00:00 app[web.1]: npm ERR! npm bugs loc8r
2016-10-11T19:51:55.491156+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-10-11T19:51:55.491308+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:55.491457+00:00 app[web.1]: npm ERR! npm owner ls loc8r
2016-10-11T19:51:55.491613+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-10-11T19:51:55.495210+00:00 app[web.1]:
2016-10-11T19:51:55.495590+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-10-11T19:51:55.495442+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-10-11T19:51:55.601435+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-10-11T19:51:55.580900+00:00 heroku[web.1]: Process exited with status 1
2016-10-11T19:57:39.619644+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=6d440a
4e-993d-4676-ae41-939426ff1ffd fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T19:57:40.240525+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=c5caca51-92c0-4532-b56c-6f060cd39634 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=
2016-10-11T20:00:42.624338+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=ef7dc9
6d-920b-4a4c-ae7a-9ccb584b1682 fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T20:00:42.771815+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=50598f55-4a3e-4b30-ac54-e77a722fb839 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=
2016-10-11T20:03:25.808113+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=9e2da8
b4-e936-4812-93a7-378ec78606f8 fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T20:03:25.961352+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=5d95a945-dcfa-4248-981d-11ce2f764b56 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=

Resources