StephenGrider / FullstackReactCode

Companion repo to https://www.udemy.com/node-with-react-fullstack-web-development
1.39k stars 1.17k forks source link

Application error #54

Closed tonetone101 closed 5 years ago

tonetone101 commented 5 years ago

Hello I am having application error. My app works in development but not on heroku. Please can anyone help? MY GITHUB LINK-https://github.com/Antkeo1/email-dev-backend

WHEN I DO HEROKU LOG --TAIL =

2019-05-22T23:21:53.000000+00:00 app[api]: Build started by user keoantonio1@gmail.com 2019-05-22T23:23:12.250882+00:00 heroku[web.1]: State changed from crashed to starting 2019-05-22T23:23:12.040681+00:00 app[api]: Deploy 0fef0da6 by user keoantonio1@gmail.com 2019-05-22T23:23:12.040681+00:00 app[api]: Release v51 created by user keoantonio1@gmail.com 2019-05-22T23:23:20.592282+00:00 heroku[web.1]: Starting process with command npm start 2019-05-22T23:23:24.975008+00:00 app[web.1]: 2019-05-22T23:23:24.975032+00:00 app[web.1]: > server@1.0.0 start /app 2019-05-22T23:23:24.975033+00:00 app[web.1]: > node index.js 2019-05-22T23:23:24.975035+00:00 app[web.1]: 2019-05-22T23:23:25.764726+00:00 app[web.1]: module.js:538 2019-05-22T23:23:25.764755+00:00 app[web.1]: throw err; 2019-05-22T23:23:25.764757+00:00 app[web.1]: ^ 2019-05-22T23:23:25.764758+00:00 app[web.1]: 2019-05-22T23:23:25.764761+00:00 app[web.1]: Error: Cannot find module './models/User' 2019-05-22T23:23:25.764763+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:536:15) 2019-05-22T23:23:25.764764+00:00 app[web.1]: at Function.Module._load (module.js:466:25) 2019-05-22T23:23:25.764767+00:00 app[web.1]: at Module.require (module.js:579:17) 2019-05-22T23:23:25.764769+00:00 app[web.1]: at require (internal/module.js:11:18) 2019-05-22T23:23:25.764770+00:00 app[web.1]: at Object. (/app/index.js:6:1) 2019-05-22T23:23:25.764771+00:00 app[web.1]: at Module._compile (module.js:635:30) 2019-05-22T23:23:25.764773+00:00 app[web.1]: at Object.Module._extensions..js (module.js:646:10) 2019-05-22T23:23:25.764775+00:00 app[web.1]: at Module.load (module.js:554:32) 2019-05-22T23:23:25.764776+00:00 app[web.1]: at tryModuleLoad (module.js:497:12) 2019-05-22T23:23:25.764778+00:00 app[web.1]: at Function.Module._load (module.js:489:3) 2019-05-22T23:23:25.764779+00:00 app[web.1]: at Function.Module.runMain (module.js:676:10) 2019-05-22T23:23:25.764781+00:00 app[web.1]: at startup (bootstrap_node.js:187:16) 2019-05-22T23:23:25.764784+00:00 app[web.1]: at bootstrap_node.js:608:3 2019-05-22T23:23:25.776388+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-05-22T23:23:25.776777+00:00 app[web.1]: npm ERR! errno 1 2019-05-22T23:23:25.778119+00:00 app[web.1]: npm ERR! server@1.0.0 start: node index.js 2019-05-22T23:23:25.778304+00:00 app[web.1]: npm ERR! Exit status 1 2019-05-22T23:23:25.778593+00:00 app[web.1]: npm ERR! 2019-05-22T23:23:25.778763+00:00 app[web.1]: npm ERR! Failed at the server@1.0.0 start script. 2019-05-22T23:23:25.778984+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-05-22T23:23:25.786218+00:00 app[web.1]: 2019-05-22T23:23:25.786547+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-05-22T23:23:25.786706+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-05-22T23_23_25_780Z-debug.log 2019-05-22T23:23:25.953530+00:00 heroku[web.1]: State changed from starting to crashed 2019-05-22T23:23:25.965631+00:00 heroku[web.1]: State changed from crashed to starting 2019-05-22T23:23:25.928193+00:00 heroku[web.1]: Process exited with status 1 2019-05-22T23:23:17.000000+00:00 app[api]: Build succeeded 2019-05-22T23:23:31.961184+00:00 heroku[web.1]: Starting process with command npm start 2019-05-22T23:23:33.874821+00:00 app[web.1]: 2019-05-22T23:23:33.874848+00:00 app[web.1]: > server@1.0.0 start /app 2019-05-22T23:23:33.874849+00:00 app[web.1]: > node index.js 2019-05-22T23:23:33.874851+00:00 app[web.1]: 2019-05-22T23:23:34.395668+00:00 app[web.1]: module.js:538 2019-05-22T23:23:34.395709+00:00 app[web.1]: throw err; 2019-05-22T23:23:34.395711+00:00 app[web.1]: ^ 2019-05-22T23:23:34.395712+00:00 app[web.1]: 2019-05-22T23:23:34.395714+00:00 app[web.1]: Error: Cannot find module './models/User' 2019-05-22T23:23:34.395716+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:536:15) 2019-05-22T23:23:34.395718+00:00 app[web.1]: at Function.Module._load (module.js:466:25) 2019-05-22T23:23:34.395720+00:00 app[web.1]: at Module.require (module.js:579:17) 2019-05-22T23:23:34.395721+00:00 app[web.1]: at require (internal/module.js:11:18) 2019-05-22T23:23:34.395722+00:00 app[web.1]: at Object. (/app/index.js:6:1) 2019-05-22T23:23:34.395724+00:00 app[web.1]: at Module._compile (module.js:635:30) 2019-05-22T23:23:34.395726+00:00 app[web.1]: at Object.Module._extensions..js (module.js:646:10) 2019-05-22T23:23:34.395727+00:00 app[web.1]: at Module.load (module.js:554:32) 2019-05-22T23:23:34.395729+00:00 app[web.1]: at tryModuleLoad (module.js:497:12) 2019-05-22T23:23:34.395730+00:00 app[web.1]: at Function.Module._load (module.js:489:3) 2019-05-22T23:23:34.395732+00:00 app[web.1]: at Function.Module.runMain (module.js:676:10) 2019-05-22T23:23:34.395733+00:00 app[web.1]: at startup (bootstrap_node.js:187:16) 2019-05-22T23:23:34.395735+00:00 app[web.1]: at bootstrap_node.js:608:3 2019-05-22T23:23:34.404062+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-05-22T23:23:34.404356+00:00 app[web.1]: npm ERR! errno 1 2019-05-22T23:23:34.405444+00:00 app[web.1]: npm ERR! server@1.0.0 start: node index.js 2019-05-22T23:23:34.405598+00:00 app[web.1]: npm ERR! Exit status 1 2019-05-22T23:23:34.405768+00:00 app[web.1]: npm ERR! 2019-05-22T23:23:34.405881+00:00 app[web.1]: npm ERR! Failed at the server@1.0.0 start script. 2019-05-22T23:23:34.405993+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-05-22T23:23:34.413071+00:00 app[web.1]: 2019-05-22T23:23:34.413296+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-05-22T23:23:34.413443+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-05-22T23_23_34_407Z-debug.log 2019-05-22T23:23:34.487563+00:00 heroku[web.1]: State changed from starting to crashed 2019-05-22T23:23:34.473124+00:00 heroku[web.1]: Process exited with status 1 2019-05-22T23:24:32.480328+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=floating-gorge-22160.herokuapp.com request_id=3921975d-d549-44cd-b126-bc43105a7f0c fwd="72.221.66.238" dyno= connect= service= status=503 bytes= protocol=https 2019-05-22T23:24:32.997587+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=floating-gorge-22160.herokuapp.com request_id=25e9efb1-513c-4b55-b3f9-d69cc1e2eda8 fwd="72.221.66.238" dyno= connect= service= status=503 bytes= protocol=https

dhuang612 commented 5 years ago

Your app can't find: Error: Cannot find module './models/User' Check and make sure the file exists where you told your program it does.

tonetone101 commented 5 years ago

This isssue is now fixed. I labeled my user file as 'User.js', but when I changed it to 'user.js' everything worked.