On reading the logs it seems as if there is a problem in google OAuth because its callback URL is localhost:3000. So I am not unable to fix it.
These are the heroku logs
2020-08-06T18:58:51.639489+00:00 heroku[web.1]: Starting process with command `npm start`2020-08-06T18:58:55.667318+00:00 app[web.1]:
2020-08-06T18:58:55.667346+00:00 app[web.1]: > secrets#1.0.0 start /app
2020-08-06T18:58:55.667346+00:00 app[web.1]: > node index.js
2020-08-06T18:58:55.667347+00:00 app[web.1]:
2020-08-06T18:58:56.738632+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-08-06T18:58:56.738668+00:00 app[web.1]: designed for a production environment, as it will leak
2020-08-06T18:58:56.738669+00:00 app[web.1]: memory, and will not scale past a single process.
2020-08-06T18:58:56.785355+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-08-06T18:58:56.785357+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-08-06T18:58:56.785358+00:00 app[web.1]: ^
2020-08-06T18:58:56.785359+00:00 app[web.1]:
2020-08-06T18:58:56.785359+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-08-06T18:58:56.785360+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-08-06T18:58:56.785360+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-08-06T18:58:56.785361+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:65:3)
2020-08-06T18:58:56.785361+00:00 app[web.1]: at Module._compile (module.js:570:32)
2020-08-06T18:58:56.785362+00:00 app[web.1]: at Object.Module._extensions..js (module.js:579:10)
2020-08-06T18:58:56.785362+00:00 app[web.1]: at Module.load (module.js:487:32)
2020-08-06T18:58:56.785362+00:00 app[web.1]: at tryModuleLoad (module.js:446:12)
2020-08-06T18:58:56.785363+00:00 app[web.1]: at Function.Module._load (module.js:438:3)
2020-08-06T18:58:56.785363+00:00 app[web.1]: at Module.runMain (module.js:604:10)
2020-08-06T18:58:56.785363+00:00 app[web.1]: at run (bootstrap_node.js:389:7)
2020-08-06T18:58:56.785364+00:00 app[web.1]: at startup (bootstrap_node.js:149:9)
2020-08-06T18:58:56.785364+00:00 app[web.1]: at bootstrap_node.js:504:3
2020-08-06T18:58:56.796796+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-06T18:58:56.797619+00:00 app[web.1]: npm ERR! errno 1
2020-08-06T18:58:56.799572+00:00 app[web.1]: npm ERR! secrets#1.0.0 start: `node index.js`
2020-08-06T18:58:56.799846+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-06T18:58:56.800246+00:00 app[web.1]: npm ERR!
2020-08-06T18:58:56.800511+00:00 app[web.1]: npm ERR! Failed at the secrets#1.0.0 start script.
2020-08-06T18:58:56.800815+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-06T18:58:56.816356+00:00 app[web.1]:
2020-08-06T18:58:56.816594+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-06T18:58:56.816734+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-08-06T18_58_56_803Z-debug.log
2020-08-06T18:58:56.882429+00:00 heroku[web.1]: Process exited with status 1
2020-08-06T18:58:56.923979+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-06T18:58:56.930118+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-06T18:59:00.529632+00:00 heroku[web.1]: Starting process with command `npm start`2020-08-06T18:59:02.858493+00:00 app[web.1]:
2020-08-06T18:59:02.858511+00:00 app[web.1]: > secrets#1.0.0 start /app
2020-08-06T18:59:02.858512+00:00 app[web.1]: > node index.js
2020-08-06T18:59:02.858512+00:00 app[web.1]:
2020-08-06T18:59:03.775308+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-08-06T18:59:03.775334+00:00 app[web.1]: designed for a production environment, as it will leak
2020-08-06T18:59:03.775335+00:00 app[web.1]: memory, and will not scale past a single process.
2020-08-06T18:59:03.811896+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-08-06T18:59:03.811898+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-08-06T18:59:03.811898+00:00 app[web.1]: ^
2020-08-06T18:59:03.811899+00:00 app[web.1]:
2020-08-06T18:59:03.811900+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-08-06T18:59:03.811900+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-08-06T18:59:03.811900+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-08-06T18:59:03.811901+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:65:3)
2020-08-06T18:59:03.811901+00:00 app[web.1]: at Module._compile (module.js:570:32)
2020-08-06T18:59:03.811902+00:00 app[web.1]: at Object.Module._extensions..js (module.js:579:10)
2020-08-06T18:59:03.811902+00:00 app[web.1]: at Module.load (module.js:487:32)
2020-08-06T18:59:03.811902+00:00 app[web.1]: at tryModuleLoad (module.js:446:12)
2020-08-06T18:59:03.811903+00:00 app[web.1]: at Function.Module._load (module.js:438:3)
2020-08-06T18:59:03.811907+00:00 app[web.1]: at Module.runMain (module.js:604:10)
2020-08-06T18:59:03.811907+00:00 app[web.1]: at run (bootstrap_node.js:389:7)
2020-08-06T18:59:03.811908+00:00 app[web.1]: at startup (bootstrap_node.js:149:9)
2020-08-06T18:59:03.811908+00:00 app[web.1]: at bootstrap_node.js:504:3
2020-08-06T18:59:03.822926+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-06T18:59:03.823477+00:00 app[web.1]: npm ERR! errno 1
2020-08-06T18:59:03.824880+00:00 app[web.1]: npm ERR! secrets#1.0.0 start: `node index.js`
2020-08-06T18:59:03.825035+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-06T18:59:03.825267+00:00 app[web.1]: npm ERR!
2020-08-06T18:59:03.825456+00:00 app[web.1]: npm ERR! Failed at the secrets#1.0.0 start script.
2020-08-06T18:59:03.825605+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-06T18:59:03.832579+00:00 app[web.1]:
2020-08-06T18:59:03.832838+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-06T18:59:03.832980+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-08-06T18_59_03_827Z-debug.log
2020-08-06T18:59:03.902827+00:00 heroku[web.1]: Process exited with status 1
2020-08-06T18:59:03.944349+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-06T18:59:07.879891+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-anonymous.herokuapp.com request_id=ab5e9261-5105-4b89-bdd0-8f14e9397084 fwd="110.225.83.237" dyno= connect= service= status=503 bytes= protocol=https2020-08-06T18:59:08.552527+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-anonymous.herokuapp.com request_id=fa83f921-6670-4182-8f21-7a9401f92e65 fwd="110.225.83.237" dyno= connect= service= status=503 bytes= protocol=https
Not able to figure out the problem. But the app runs perfectly fine on localhost:3000
And this is the link to github repo:- https://github.com/Naman-2001/Secrets
put all of your secret/sensitive keys (clientID, clientSecret, etc...) in Heroku config vars so you can access it in your code like process.env.['YOUR SECRET PROPERTY']
Read more about Heroku Configuration and Config Vars
Related
I have a simple MERN APP, that works fine on localhost, but when I deploy it to Heroku I see a page with this error:
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
And the console is showing this: Failed to load resource: the server responded with a status of 503 (Service Unavailable)
An Image of that has also been attached!
And Heroku logs are also given below...
I'm new to MERN Dev, so can't really figure out what's the issue really is and Heroku logs are also not much of help, please help me!
Warning: heroku update available from 7.59.0 to 7.59.2.
2022-01-05T13:28:24.783142+00:00 app[web.1]:
2022-01-05T13:28:25.124488+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T13:28:25.124505+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T13:28:25.124505+00:00 app[web.1]: ^
2022-01-05T13:28:25.124506+00:00 app[web.1]:
2022-01-05T13:28:25.124507+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T13:28:25.124507+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T13:28:25.124508+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T13:28:25.124508+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T13:28:25.124510+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T13:28:25.124511+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T13:28:25.124511+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T13:28:25.129285+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T13:28:25.129543+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T13:28:25.130631+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T13:28:25.130632+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T13:28:25.130787+00:00 app[web.1]: npm ERR!
2022-01-05T13:28:25.130867+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T13:28:25.130870+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T13:28:25.135681+00:00 app[web.1]:
2022-01-05T13:28:25.135782+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T13:28:25.135828+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T13_28_25_131Z-debug.log
2022-01-05T13:28:25.273876+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T13:28:25.334794+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:58:18.000000+00:00 app[api]: Build started by user sauviksood#gmail.com
2022-01-05T14:59:12.408461+00:00 app[api]: Deploy 278ece53 by user sauviksood#gmail.com
2022-01-05T14:59:12.408461+00:00 app[api]: Release v6 created by user sauviksood#gmail.com
2022-01-05T14:59:13.000000+00:00 app[api]: Build succeeded
2022-01-05T14:59:13.762177+00:00 heroku[web.1]: State changed from crashed to starting
2022-01-05T14:59:19.381206+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-05T14:59:21.141420+00:00 app[web.1]:
2022-01-05T14:59:21.141434+00:00 app[web.1]: > server#1.0.0 start /app
2022-01-05T14:59:21.141435+00:00 app[web.1]: > node server.js
2022-01-05T14:59:21.141435+00:00 app[web.1]:
2022-01-05T14:59:21.365509+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T14:59:21.365511+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T14:59:21.365511+00:00 app[web.1]: ^
2022-01-05T14:59:21.365512+00:00 app[web.1]:
2022-01-05T14:59:21.365512+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T14:59:21.365512+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T14:59:21.365513+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:21.365513+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T14:59:21.365515+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T14:59:21.365516+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T14:59:21.365518+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:21.370906+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T14:59:21.371167+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T14:59:21.371985+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T14:59:21.372041+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T14:59:21.372158+00:00 app[web.1]: npm ERR!
2022-01-05T14:59:21.372219+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T14:59:21.372273+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T14:59:21.375303+00:00 app[web.1]:
2022-01-05T14:59:21.375391+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T14:59:21.375436+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T14_59_21_373Z-debug.log
2022-01-05T14:59:21.529167+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T14:59:21.611061+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:59:21.635160+00:00 heroku[web.1]: State changed from crashed to starting
2022-01-05T14:59:28.249204+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-05T14:59:29.604172+00:00 app[web.1]:
2022-01-05T14:59:29.604192+00:00 app[web.1]: > server#1.0.0 start /app
2022-01-05T14:59:29.604193+00:00 app[web.1]: > node server.js
2022-01-05T14:59:29.604193+00:00 app[web.1]:
2022-01-05T14:59:29.864349+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T14:59:29.864368+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T14:59:29.864369+00:00 app[web.1]: ^
2022-01-05T14:59:29.864369+00:00 app[web.1]:
2022-01-05T14:59:29.864370+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T14:59:29.864370+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T14:59:29.864370+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T14:59:29.864372+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T14:59:29.864372+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T14:59:29.864373+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T14:59:29.864373+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:29.870542+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T14:59:29.870848+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T14:59:29.871728+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T14:59:29.871798+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T14:59:29.871921+00:00 app[web.1]: npm ERR!
2022-01-05T14:59:29.871982+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T14:59:29.872035+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T14:59:29.875332+00:00 app[web.1]:
2022-01-05T14:59:29.875429+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T14:59:29.875474+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T14_59_29_872Z-debug.log
2022-01-05T14:59:30.008365+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T14:59:30.061904+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:59:31.128259+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=movie-watchlist-mern.herokuapp.com request_id=f86c07e6-1ee6-42c9-88be-3c7d1a60e53d fwd="103.155.240.47" dyno= connect= service= status=503 bytes= protocol=https
2022-01-05T14:59:34.147698+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=movie-watchlist-mern.herokuapp.com request_id=c0ccd4db-98b3-40fa-90c1-ad33cfe5a065 fwd="103.155.240.47" dyno= connect= service= status=503 bytes= protocol=https
Your heroku setup needs an update to the version 7.59.2
For this:
You have to run npm command if npm used for the heroku cli installation in you device,
npm:
npm upgrade -g heroku
Or if heroku was installed with yarn then,
yarn:
yarn global upgrade heroku
This may help your issue
I was trying to deploy my discord.js bot on heroku but I always get an error and the bot crashes. I codes are fine, I ran it on my pc and it does not give any errors. I followed this link to set up my heroku app https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up. I did exactly as it said but I get this error:
2021-10-12T08:15:45.604131+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-12T08:15:46.708903+00:00 app[web.1]:
2021-10-12T08:15:46.709032+00:00 app[web.1]: > kurumi#1.0.0 start /app
2021-10-12T08:15:46.709036+00:00 app[web.1]: > node index.js
2021-10-12T08:15:46.709036+00:00 app[web.1]:
2021-10-12T08:15:46.772460+00:00 app[web.1]: /app/node_modules/discord.js/src/rest/APIRequest.js:33
2021-10-12T08:15:46.772464+00:00 app[web.1]: agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
2021-10-12T08:15:46.772465+00:00 app[web.1]: ^^^
2021-10-12T08:15:46.772465+00:00 app[web.1]:
2021-10-12T08:15:46.772468+00:00 app[web.1]: SyntaxError: Unexpected token '??='
2021-10-12T08:15:46.772468+00:00 app[web.1]: at wrapSafe (internal/modules/cjs/loader.js:1001:16)
2021-10-12T08:15:46.772468+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1049:27)
2021-10-12T08:15:46.772471+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2021-10-12T08:15:46.772471+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:950:32)
2021-10-12T08:15:46.772471+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:790:12)
2021-10-12T08:15:46.772471+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:974:19)
2021-10-12T08:15:46.772472+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:93:18)
2021-10-12T08:15:46.772472+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/discord.js/src/rest/RESTManager.js:4:20)
2021-10-12T08:15:46.772472+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14)
2021-10-12T08:15:46.772472+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2021-10-12T08:15:46.779715+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-12T08:15:46.779895+00:00 app[web.1]: npm ERR! errno 1
2021-10-12T08:15:46.783479+00:00 app[web.1]: npm ERR! kurumi#1.0.0 start: `node index.js`
2021-10-12T08:15:46.783529+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-12T08:15:46.783595+00:00 app[web.1]: npm ERR!
2021-10-12T08:15:46.783640+00:00 app[web.1]: npm ERR! Failed at the kurumi#1.0.0 start script.
2021-10-12T08:15:46.783698+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-12T08:15:46.786955+00:00 app[web.1]:
2021-10-12T08:15:46.787031+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-12T08:15:46.787064+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-12T08_15_46_784Z-debug.log
2021-10-12T08:15:46.938086+00:00 heroku[web.1]: Process exited with status 1
2021-10-12T08:15:47.109411+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-12T08:15:47.120433+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-12T08:15:50.000000+00:00 app[api]: Build succeeded
2021-10-12T08:15:51.902833+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-12T08:15:52.879739+00:00 app[web.1]:
2021-10-12T08:15:52.879754+00:00 app[web.1]: > kurumi#1.0.0 start /app
2021-10-12T08:15:52.879755+00:00 app[web.1]: > node index.js
2021-10-12T08:15:52.879755+00:00 app[web.1]:
2021-10-12T08:15:52.943619+00:00 app[web.1]: /app/node_modules/discord.js/src/rest/APIRequest.js:33
2021-10-12T08:15:52.943621+00:00 app[web.1]: agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
2021-10-12T08:15:52.943621+00:00 app[web.1]: ^^^
2021-10-12T08:15:52.943622+00:00 app[web.1]:
2021-10-12T08:15:52.943622+00:00 app[web.1]: SyntaxError: Unexpected token '??='
2021-10-12T08:15:52.943623+00:00 app[web.1]: at wrapSafe (internal/modules/cjs/loader.js:1001:16)
2021-10-12T08:15:52.943623+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1049:27)
2021-10-12T08:15:52.943624+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2021-10-12T08:15:52.943624+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:950:32)
2021-10-12T08:15:52.943624+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:790:12)
2021-10-12T08:15:52.943625+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:974:19)
2021-10-12T08:15:52.943625+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:93:18)
2021-10-12T08:15:52.943625+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/discord.js/src/rest/RESTManager.js:4:20)
2021-10-12T08:15:52.943627+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14)
2021-10-12T08:15:52.943627+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2021-10-12T08:15:52.950345+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-12T08:15:52.950523+00:00 app[web.1]: npm ERR! errno 1
2021-10-12T08:15:52.953970+00:00 app[web.1]: npm ERR! kurumi#1.0.0 start: `node index.js`
2021-10-12T08:15:52.954012+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-12T08:15:52.954061+00:00 app[web.1]: npm ERR!
2021-10-12T08:15:52.954092+00:00 app[web.1]: npm ERR! Failed at the kurumi#1.0.0 start script.
2021-10-12T08:15:52.954134+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-12T08:15:52.956414+00:00 app[web.1]:
2021-10-12T08:15:52.956490+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-12T08:15:52.956517+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-12T08_15_52_954Z-debug.log
2021-10-12T08:15:53.132196+00:00 heroku[web.1]: Process exited with status 1
2021-10-12T08:15:53.198551+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-12T08:16:14.979868+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gentle-thicket-97709.herokuapp.com request_id=bc0fd458-0a88-4f7f-8fe6-7a21d52e3035 fwd="114.31.4.178" dyno= connect= service= status=503 bytes= protocol=https
2021-10-12T08:16:15.988690+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gentle-thicket-97709.herokuapp.com request_id=b830f6e2-5525-4310-b415-4e902015b8e3 fwd="114.31.4.178" dyno= connect= service= status=503 bytes= protocol=https
Heroku have very low nodejs version and you can't update it sadly, so there is no real way to fix it. You still can run a bot here if it works on djs v12.5.3
You can specify a node version in the package.json with the engines property when using heroku. Can you try setting the version to 15 or higher?
{
"name": "myapp",
"description": "a really cool app",
"version": "1.0.0",
"engines": {
"node": "15.x"
}
}
i'v noticed that this question been asked before but none of them covers my problem.
anyway i'v deployed a node.js project to heroku using the Heroku CLI , and it works 100%.
later on I linked it to GitHub and wanted to deploy it using GitHub , deploy was successful but the application giving an error.
I gitignored the node_modules , db and config just incase and that needed to be said.
I'v restarted all dynos
repo is set on private in GitHub
any ideas please ?
2021-06-12T08:01:52.352038+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:01:52.352203+00:00 app[web.1]: npm ERR!
2021-06-12T08:01:52.352360+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:01:52.352478+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:01:52.363711+00:00 app[web.1]:
2021-06-12T08:01:52.363960+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:01:52.364068+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_01_52_353Z-debug.log
2021-06-12T08:01:52.467709+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:01:52.554484+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-12T08:28:17.040842+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mapetme.herokuapp.com request_id=bac4c71c-e9a9-4df1-82d3-30049c040f7f fwd="109.253.222.209" dyno= connect= service= status=503 bytes= protocol=https
2021-06-12T08:32:34.601328+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mapetme.herokuapp.com request_id=b28e1630-8739-44a1-8bab-50b6347b91e7 fwd="109.253.222.209" dyno= connect= service= status=503 bytes= protocol=https
2021-06-12T08:32:44.055618+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-12T08:32:46.496214+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-12T08:32:48.862282+00:00 app[web.1]:
2021-06-12T08:32:48.862304+00:00 app[web.1]: > l6_13_04#1.0.0 start /app
2021-06-12T08:32:48.862305+00:00 app[web.1]: > node app
2021-06-12T08:32:48.862305+00:00 app[web.1]:
2021-06-12T08:32:49.439470+00:00 app[web.1]: internal/modules/cjs/loader.js:1122
2021-06-12T08:32:49.439537+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2021-06-12T08:32:49.439539+00:00 app[web.1]: ^
2021-06-12T08:32:49.439540+00:00 app[web.1]:
2021-06-12T08:32:49.439541+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2021-06-12T08:32:49.439542+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Object.<anonymous> (/app/routes/users.js:2:16)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:49.439547+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:49.439547+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.453105+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-12T08:32:49.453413+00:00 app[web.1]: npm ERR! errno 1
2021-06-12T08:32:49.458918+00:00 app[web.1]: npm ERR! l6_13_04#1.0.0 start: `node app`
2021-06-12T08:32:49.459026+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:32:49.459155+00:00 app[web.1]: npm ERR!
2021-06-12T08:32:49.459250+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:32:49.459341+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:32:49.464221+00:00 app[web.1]:
2021-06-12T08:32:49.464367+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:32:49.464451+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_32_49_460Z-debug.log
2021-06-12T08:32:49.523466+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:32:49.596420+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-12T08:32:49.622795+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-12T08:32:52.222185+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-12T08:32:54.529651+00:00 app[web.1]:
2021-06-12T08:32:54.529669+00:00 app[web.1]: > l6_13_04#1.0.0 start /app
2021-06-12T08:32:54.529669+00:00 app[web.1]: > node app
2021-06-12T08:32:54.529670+00:00 app[web.1]:
2021-06-12T08:32:55.075602+00:00 app[web.1]: internal/modules/cjs/loader.js:1122
2021-06-12T08:32:55.075622+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2021-06-12T08:32:55.075631+00:00 app[web.1]: ^
2021-06-12T08:32:55.075632+00:00 app[web.1]:
2021-06-12T08:32:55.075633+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2021-06-12T08:32:55.075634+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at Object.<anonymous> (/app/routes/users.js:2:16)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.095077+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-12T08:32:55.095371+00:00 app[web.1]: npm ERR! errno 1
2021-06-12T08:32:55.102335+00:00 app[web.1]: npm ERR! l6_13_04#1.0.0 start: `node app`
2021-06-12T08:32:55.102427+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:32:55.102549+00:00 app[web.1]: npm ERR!
2021-06-12T08:32:55.102638+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:32:55.102723+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:32:55.108249+00:00 app[web.1]:
2021-06-12T08:32:55.108497+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:32:55.108632+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_32_55_103Z-debug.log
2021-06-12T08:32:55.200979+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:32:55.265806+00:00 heroku[web.1]: State changed from starting to crashed
try making the repo to public and check it works or not
after trying a bunch of more solutions on the internet.
only deleting the node_modules and pretty much initializing everything fixed it for me.
I finished working on my website, and everything works great locally, but I get an error when deploying to heroku.
Some background:
Back-end server was built using this tutorial (Express.js + Sequelize + PostgreSQL): https://www.djamware.com/post/5b56a6cc80aca707dd4f65a9/nodejs-expressjs-sequelizejs-and-postgresql-restful-api
Front-end was built by using npx create-react-app command.
Deploying issue
Now, for deploying I used the tutorial at https://www.freecodecamp.org/news/deploy-a-react-node-app-to/ and created a new Postgres Database on heroku (and that's it).
When I try to view the site at "xxxxx.herokuapp.com" this "Application error" message:
So i tried running the heroku logs --tail command and this was the message I got:
heroku logs --tail -a grades-il
2020-10-09T15:26:15.091358+00:00 heroku[web.1]: Starting process with command `npm start`
2020-10-09T15:26:17.586004+00:00 heroku[web.1]: Process exited with status 1
2020-10-09T15:26:17.623057+00:00 heroku[web.1]: State changed from starting to crashed
2020-10-09T15:26:17.333545+00:00 app[web.1]:
2020-10-09T15:26:17.333566+00:00 app[web.1]: > node-sequelize#0.0.0 start /app
2020-10-09T15:26:17.333567+00:00 app[web.1]: > node ./bin/www
2020-10-09T15:26:17.333567+00:00 app[web.1]:
2020-10-09T15:26:17.505070+00:00 app[web.1]: internal/modules/cjs/loader.js:834
2020-10-09T15:26:17.505072+00:00 app[web.1]: throw err;
2020-10-09T15:26:17.505072+00:00 app[web.1]: ^
2020-10-09T15:26:17.505072+00:00 app[web.1]:
2020-10-09T15:26:17.505073+00:00 app[web.1]: Error: Cannot find module './school'
2020-10-09T15:26:17.505073+00:00 app[web.1]: Require stack:
2020-10-09T15:26:17.505073+00:00 app[web.1]: - /app/controllers/index.js
2020-10-09T15:26:17.505074+00:00 app[web.1]: - /app/routes/index.js
2020-10-09T15:26:17.505074+00:00 app[web.1]: - /app/app.js
2020-10-09T15:26:17.505074+00:00 app[web.1]: - /app/bin/www
2020-10-09T15:26:17.505075+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
2020-10-09T15:26:17.505075+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:687:27)
2020-10-09T15:26:17.505075+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:903:19)
2020-10-09T15:26:17.505075+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2020-10-09T15:26:17.505076+00:00 app[web.1]: at Object.<anonymous> (/app/controllers/index.js:1:16)
2020-10-09T15:26:17.505076+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1015:30)
2020-10-09T15:26:17.505076+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
2020-10-09T15:26:17.505076+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:879:32)
2020-10-09T15:26:17.505077+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2020-10-09T15:26:17.505077+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:903:19) {
2020-10-09T15:26:17.505077+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-10-09T15:26:17.505077+00:00 app[web.1]: requireStack: [
2020-10-09T15:26:17.505078+00:00 app[web.1]: '/app/controllers/index.js',
2020-10-09T15:26:17.505078+00:00 app[web.1]: '/app/routes/index.js',
2020-10-09T15:26:17.505078+00:00 app[web.1]: '/app/app.js',
2020-10-09T15:26:17.505079+00:00 app[web.1]: '/app/bin/www'
2020-10-09T15:26:17.505079+00:00 app[web.1]: ]
2020-10-09T15:26:17.505079+00:00 app[web.1]: }
2020-10-09T15:26:17.515720+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-10-09T15:26:17.515920+00:00 app[web.1]: npm ERR! errno 1
2020-10-09T15:26:17.520600+00:00 app[web.1]: npm ERR! node-sequelize#0.0.0 start: `node ./bin/www`
2020-10-09T15:26:17.520705+00:00 app[web.1]: npm ERR! Exit status 1
2020-10-09T15:26:17.520815+00:00 app[web.1]: npm ERR!
2020-10-09T15:26:17.520929+00:00 app[web.1]: npm ERR! Failed at the node-sequelize#0.0.0 start script.
2020-10-09T15:26:17.521011+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-10-09T15:26:17.525367+00:00 app[web.1]:
2020-10-09T15:26:17.525509+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-10-09T15:26:17.525583+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-10-09T15_26_17_521Z-debug.log
2020-10-09T15:27:20.340920+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxx.herokuapp.com request_id=320b7a37-e1e9-4974-92b0-b98e6af2667a fwd="79.177.39.29" dyno= connect= service= status=503 bytes= protocol=http
2020-10-09T15:27:20.850485+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxx.herokuapp.com request_id=23268c05-28cf-4fc4-9aa7-8ef69befa2b2 fwd="79.177.39.29" dyno= connect= service= status=503 bytes= protocol=http
So if you have any idea how to fix this, I'd appreciate your help.
Thanks!
Thanks to Mohit Karekar I solved the problem by just changing
require('./school');
to
require('./School');
and that's it.
I'm attempting to launch my MERN stack app with Heroku, it works on my localhost but following the directions for heroku, I keep getting this H10 error and I feel like it is something trivial that I've missed. I've hit a wall.
I've looked at the logs, and nothing was helpful, changed the URL, updated the package.json. I originally had too many pkg.json (one in the main folder and one in each of the front and backends), deleted the main folder pkg.json, it's not a node error
heroku logs
2019-05-06T01:22:20.905343+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-06T01:22:20.635909+00:00 app[web.1]: > coding-challenge#1.0.0 start /app
2019-05-06T01:22:20.635910+00:00 app[web.1]: > node server.js
2019-05-06T01:22:20.826762+00:00 app[web.1]: internal/modules/cjs/loader.js:611
2019-05-06T01:22:20.826766+00:00 app[web.1]: throw err;
2019-05-06T01:22:20.826768+00:00 app[web.1]: ^
2019-05-06T01:22:20.826771+00:00 app[web.1]: Error: Cannot find module 'cors'
2019-05-06T01:22:20.826773+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
2019-05-06T01:22:20.826775+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:535:25)
2019-05-06T01:22:20.826776+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:663:17)
2019-05-06T01:22:20.826777+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:20:18)
2019-05-06T01:22:20.826779+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2019-05-06T01:22:20.826780+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:734:30)
2019-05-06T01:22:20.826781+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
2019-05-06T01:22:20.826782+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:626:32)
2019-05-06T01:22:20.826783+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
2019-05-06T01:22:20.826785+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:558:3)
2019-05-06T01:22:20.833856+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-05-06T01:22:20.834362+00:00 app[web.1]: npm ERR! errno 1
2019-05-06T01:22:20.835547+00:00 app[web.1]: npm ERR! coding-challenge#1.0.0 start: `node server.js`
2019-05-06T01:22:20.835696+00:00 app[web.1]: npm ERR! Exit status 1
2019-05-06T01:22:20.835933+00:00 app[web.1]: npm ERR!
2019-05-06T01:22:20.836101+00:00 app[web.1]: npm ERR! Failed at the coding-challenge#1.0.0 start script.
2019-05-06T01:22:20.836250+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-05-06T01:22:20.843776+00:00 app[web.1]:
2019-05-06T01:22:20.843920+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-05-06T01:22:20.844004+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-05-06T01_22_20_837Z-debug.log
2019-05-06T01:22:20.885179+00:00 heroku[web.1]: Process exited with status 1
2019-05-06T01:22:23.822929+00:00 heroku[web.1]: Starting process with command `npm start`
2019-05-06T01:22:26.506313+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-06T01:22:26.221158+00:00 app[web.1]:
2019-05-06T01:22:26.221187+00:00 app[web.1]: > coding-challenge#1.0.0 start /app
2019-05-06T01:22:26.221190+00:00 app[web.1]: > node server.js
2019-05-06T01:22:26.221192+00:00 app[web.1]:
2019-05-06T01:22:26.431669+00:00 app[web.1]: internal/modules/cjs/loader.js:611
2019-05-06T01:22:26.431673+00:00 app[web.1]: throw err;
2019-05-06T01:22:26.431674+00:00 app[web.1]: ^
2019-05-06T01:22:26.431676+00:00 app[web.1]:
2019-05-06T01:22:26.431678+00:00 app[web.1]: Error: Cannot find module 'cors'
2019-05-06T01:22:26.431680+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
2019-05-06T01:22:26.431682+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:535:25)
2019-05-06T01:22:26.431684+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:663:17)
2019-05-06T01:22:26.431687+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:20:18)
2019-05-06T01:22:26.431688+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2019-05-06T01:22:26.431690+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:734:30)
2019-05-06T01:22:26.431692+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
2019-05-06T01:22:26.431694+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:626:32)
2019-05-06T01:22:26.431695+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
2019-05-06T01:22:26.431697+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:558:3)
2019-05-06T01:22:26.438865+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-05-06T01:22:26.439262+00:00 app[web.1]: npm ERR! errno 1
2019-05-06T01:22:26.440416+00:00 app[web.1]: npm ERR! coding-challenge#1.0.0 start: `node server.js`
2019-05-06T01:22:26.440555+00:00 app[web.1]: npm ERR! Exit status 1
2019-05-06T01:22:26.440783+00:00 app[web.1]: npm ERR!
2019-05-06T01:22:26.440937+00:00 app[web.1]: npm ERR! Failed at the coding-challenge#1.0.0 start script.
2019-05-06T01:22:26.441081+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-05-06T01:22:26.448596+00:00 app[web.1]:
2019-05-06T01:22:26.448750+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-05-06T01:22:26.448803+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-05-06T01_22_26_442Z-debug.log
2019-05-06T01:22:26.493385+00:00 heroku[web.1]: Process exited with status 1
2019-05-06T01:45:52.690438+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-wildwood-76480.herokuapp.com request_id=b1c76bb1-2948-45cd-929b-b579eb45e29b fwd="24.192.243.229" dyno= connect= service= status=503 bytes= protocol=https
2019-05-06T01:45:54.362863+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=intense-wildwood-76480.herokuapp.com request_id=df6c81f1-df99-4d50-af11-baff32648e77 fwd="24.192.243.229" dyno= connect= service= status=503 bytes= protocol=https
2019-05-06T01:53:45.184100+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-06T01:53:48.182538+00:00 heroku[web.1]: Starting process with command `npm start`
2019-05-06T01:53:51.404026+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-06T01:53:50.980526+00:00 app[web.1]:
2019-05-06T01:53:50.980548+00:00 app[web.1]: > coding-challenge#1.0.0 start /app
2019-05-06T01:53:50.980551+00:00 app[web.1]: > node server.js
2019-05-06T01:53:50.980552+00:00 app[web.1]:
2019-05-06T01:53:51.263052+00:00 app[web.1]: internal/modules/cjs/loader.js:611
2019-05-06T01:53:51.263083+00:00 app[web.1]: throw err;
2019-05-06T01:53:51.263084+00:00 app[web.1]: ^
2019-05-06T01:53:51.263086+00:00 app[web.1]:
2019-05-06T01:53:51.263087+00:00 app[web.1]: Error: Cannot find module 'cors'
2019-05-06T01:53:51.263089+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
2019-05-06T01:53:51.263091+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:535:25)
2019-05-06T01:53:51.263093+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:663:17)
2019-05-06T01:53:51.263094+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:20:18)
2019-05-06T01:53:51.263096+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:14)
2019-05-06T01:53:51.263097+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:734:30)
2019-05-06T01:53:51.263099+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
2019-05-06T01:53:51.263100+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:626:32)
2019-05-06T01:53:51.263102+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
2019-05-06T01:53:51.263103+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:558:3)
2019-05-06T01:53:51.274764+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-05-06T01:53:51.274769+00:00 app[web.1]: npm ERR! errno 1
2019-05-06T01:53:51.278740+00:00 app[web.1]: npm ERR! coding-challenge#1.0.0 start: `node server.js`
2019-05-06T01:53:51.278744+00:00 app[web.1]: npm ERR! Exit status 1
2019-05-06T01:53:51.278746+00:00 app[web.1]: npm ERR!
2019-05-06T01:53:51.278748+00:00 app[web.1]: npm ERR! Failed at the coding-challenge#1.0.0 start script.
2019-05-06T01:53:51.278750+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-05-06T01:53:51.287320+00:00 app[web.1]:
2019-05-06T01:53:51.287325+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-05-06T01:53:51.287327+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-05-06T01_53_51_279Z-debug.log
2019-05-06T01:53:51.386095+00:00 heroku[web.1]: Process exited with status 1
2019-05-06T02:07:06.872526+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-wildwood-76480.herokuapp.com request_id=c14c2030-244d-469e-8953-d99d8e1d6fe8 fwd="24.192.243.229" dyno= connect= service= status=503 bytes= protocol=https
2019-05-06T02:07:08.695039+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=intense-wildwood-76480.herokuapp.com request_id=3532bee8-9b55-43ed-87ec-9bd7c2706efb fwd="24.192.243.229" dyno= connect= service= status=503 bytes= protocol=https
Looks like the module cors hasn't been installed. I think Heroku should automatically run npm install in your project for you, but you have to list the dependencies in your package.json.
Inside package.json do you have the cors dependency inside the dependencies object? If not you should add it so it looks something like
// package.json
{
"dependencies": {
"cors": "*"
}
}