Git Product home page Git Product logo

fullstackreactcode's Introduction

fullstackreactcode's People

Contributors

stephengrider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fullstackreactcode's Issues

[Lecture 111] I can't apply heroku server

I can't push current git branch's source code to heroku server.
My local server and client is very good! But I can't deploy to heroku!
Please, Help me !
Anyone has same problem ?


2018-05-18T04:25:42.047499+00:00 heroku[router]: at=info method=GET path="/register" host=desolate-wave-93547.herokuapp.com request_id=203a6b1a-12cf-48cf-82b5-323eeccc714f fwd="24.5.226.71" dyno=web.1 connect=0ms service=6ms status=304 bytes=237 protocol=https
2018-05-18T04:25:42.161628+00:00 heroku[router]: at=info method=GET path="/static/css/main.c5d7d2bf.css" host=desolate-wave-93547.herokuapp.com request_id=e2c6869b-2d98-4d54-ac75-0f01db7e5f0d fwd="24.5.226.71" dyno=web.1 connect=0ms service=3ms status=304 bytes=239 protocol=https
2018-05-18T04:25:42.166638+00:00 heroku[router]: at=info method=GET path="/static/js/main.4d96b974.js" host=desolate-wave-93547.herokuapp.com request_id=52f4caad-46cb-4e3a-b0d9-068dc4d517b5 fwd="24.5.226.71" dyno=web.1 connect=0ms service=7ms status=304 bytes=239 protocol=https
2018-05-18T04:25:42.373955+00:00 heroku[router]: at=info method=GET path="/static/js/main.4d96b974.js.map" host=desolate-wave-93547.herokuapp.com request_id=e2a1d870-6b5a-400d-ba62-0ecc4f952b07 fwd="24.5.226.71" dyno=web.1 connect=0ms service=3ms status=304 bytes=240 protocol=https
2018-05-18T04:25:42.372608+00:00 heroku[router]: at=info method=GET path="/api/current_user" host=desolate-wave-93547.herokuapp.com request_id=428d2b0b-0c7c-49f1-b4e9-2f19c50f1082 fwd="24.5.226.71" dyno=web.1 connect=0ms service=1ms status=200 bytes=117 protocol=https
2018-05-18T04:25:42.464844+00:00 heroku[router]: at=info method=GET path="/static/media/Roboto-Regular.5136cbe6.woff2" host=desolate-wave-93547.herokuapp.com request_id=13dd109c-b456-4594-80d0-b678b33bf22a fwd="24.5.226.71" dyno=web.1 connect=0ms service=6ms status=304 bytes=238 protocol=https
2018-05-18T04:25:42.465064+00:00 heroku[router]: at=info method=GET path="/static/css/main.c5d7d2bf.css.map" host=desolate-wave-93547.herokuapp.com request_id=cc6cebdd-9791-467c-a70d-afe6eb01693a fwd="24.5.226.71" dyno=web.1 connect=0ms service=4ms status=304 bytes=239 protocol=https

react-scripts: not found while pushing to heroku

Hi, please whenever i try to push to heroku using : git push heroku master, I get this error.

Counting objects: 12, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 31.45 KiB | 0 bytes/s, done.
Total 12 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 9.4.0
remote: engines.npm (package.json): 5.6.0
remote:
remote: Resolving node version 9.4.0...
remote: Downloading and installing node 9.4.0...
remote: npm 5.6.0 already installed with node
remote:
remote: -----> Restoring cache
remote: Loading 2 from cacheDirectories (default):
remote: - node_modules
remote: - bower_components (not cached - skipping)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote: added 17 packages in 2.327s
remote: Running heroku-postbuild
remote:
remote: > [email protected] heroku-postbuild /tmp/build_29056fffc5fdcc0026d532b01dc8bfad
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote: added 18 packages in 3.537s
remote:
remote: > [email protected] build /tmp/build_29056fffc5fdcc0026d532b01dc8bfad/client
remote: > react-scripts build
remote:
remote: sh: 1: react-scripts: not found
remote: npm ERR! file sh
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno ENOENT
remote: npm ERR! syscall spawn
remote: npm ERR! [email protected] build: react-scripts build
remote: npm ERR! spawn ENOENT
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2018-01-21T00_28_13_886Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] heroku-postbuild: NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2018-01-21T00_28_13_900Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
.

here is my package.json file:

{
"name": "scholarlyft",
"version": "1.0.0",
"description": "An educational website",
"main": "index.js",
"engines": {
"node": "9.4.0",
"npm": "5.6.0"
},
"scripts": {
"start": "node index.js",
"server": "nodemon index.js",
"client": "npm run start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "Edward Alozieuwa",
"license": "ISC",
"dependencies": {
"concurrently": "^3.5.1",
"express": "^4.16.2"
},
"devDependencies": {
"nodemon": "^1.14.11"
}
}

Please help!

Oauth2 Strategy error

When testing Oauth, below is the error I am receiving when starting the service:

Oauth2Strategy requires a ClientID option

I followed the instructions discussed in section 3, video 22 (Google Strategy Option).

Missing modules when running npm run build or npm install

Hi.

I am starting with the Udemy class on a server project and I am trying to get it all setup and working.

I have cloned the preexisting repository howoever every time I run pretty much any npm command I get the following output:

node index.js

module.js:327
throw err;
^

Error: Cannot find module './dev'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/Users/jchiu/Desktop/javascript/FullStackSteven/FullstackReactCode/server/config/keys.js:7:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/Users/jchiu/Desktop/javascript/FullStackSteven/FullstackReactCode/server/index.js:6:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have uninstalled node_modules completely and reinstalled it again.

rm -rf node_modules
npm install
provide the contents of that error message

It seems that I must have large dependency missing because every time I try to install the module that it says its missing it just complains about another module missing. Im a bit new to these package managers but aren't supposed to take care of all the dependencie.

Thank you.

auth/google/callback timeout issue

I've gone through the code you supplied here twice, replacing all of the steps that you have and cannot get this timeout issue corrected. When you click to login it just hangs and then heroku pushes application error page.

Git link to project: https://github.com/beardedguru/emaily-app

Api is enabled inside of google developer:

image

Restrictions are setup as follows:

image

Have triple checked heroku environment details and they are correct.

Any help would be appreciated.

Unable to launch app on heroku (@ lecture 49)

I receive an application error when I try to run heroku open after pushing to the heroku master.
Below is an output of my heroku logs --tail.

The project works if I"m running it locally on localhost:5000

2018-12-24T19:31:45.900464+00:00 app[web.1]: npm ERR! Exit status 1
2018-12-24T19:31:45.900770+00:00 app[web.1]: npm ERR!
2018-12-24T19:31:45.901027+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2018-12-24T19:31:45.901335+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-24T19:31:45.903229+00:00 app[web.1]:
2018-12-24T19:31:45.903557+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-24T19:31:45.903769+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-24T19_31_45_892Z-debug.log
2018-12-24T19:31:46.045578+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-24T19:31:46.021125+00:00 heroku[web.1]: Process exited with status 1
2018-12-24T19:31:51.589446+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-bayou-54764.herokuapp.com request_id=3ad592e2-93bc-4bb9-b91e-53a123fa0b04 fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:31:58.232581+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/auth/google" host=immense-bayou-54764.herokuapp.com request_id=e0ae4f2a-96c4-4852-84e0-e7aa1ff82a53 fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:33:48.390847+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-24T19:33:51.360139+00:00 heroku[web.1]: Starting process with command npm start
2018-12-24T19:33:55.246869+00:00 app[web.1]:
2018-12-24T19:33:55.246892+00:00 app[web.1]: > [email protected] start /app
2018-12-24T19:33:55.246894+00:00 app[web.1]: > node index.js
2018-12-24T19:33:55.246895+00:00 app[web.1]:
2018-12-24T19:33:56.255148+00:00 app[web.1]: module.js:487
2018-12-24T19:33:56.255193+00:00 app[web.1]: throw err;
2018-12-24T19:33:56.255195+00:00 app[web.1]: ^
2018-12-24T19:33:56.255197+00:00 app[web.1]:
2018-12-24T19:33:56.255200+00:00 app[web.1]: Error: Cannot find module './models/User'
2018-12-24T19:33:56.255202+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:485:15)
2018-12-24T19:33:56.255207+00:00 app[web.1]: at Function.Module._load (module.js:437:25)
2018-12-24T19:33:56.255209+00:00 app[web.1]: at Module.require (module.js:513:17)
2018-12-24T19:33:56.255211+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-12-24T19:33:56.255212+00:00 app[web.1]: at Object. (/app/index.js:8:1)
2018-12-24T19:33:56.255214+00:00 app[web.1]: at Module._compile (module.js:569:30)
2018-12-24T19:33:56.255216+00:00 app[web.1]: at Object.Module._extensions..js (module.js:580:10)
2018-12-24T19:33:56.255217+00:00 app[web.1]: at Module.load (module.js:503:32)
2018-12-24T19:33:56.255219+00:00 app[web.1]: at tryModuleLoad (module.js:466:12)
2018-12-24T19:33:56.255220+00:00 app[web.1]: at Function.Module._load (module.js:458:3)
2018-12-24T19:33:56.255222+00:00 app[web.1]: at Function.Module.runMain (module.js:605:10)
2018-12-24T19:33:56.255224+00:00 app[web.1]: at startup (bootstrap_node.js:158:16)
2018-12-24T19:33:56.255225+00:00 app[web.1]: at bootstrap_node.js:575:3
2018-12-24T19:33:56.307331+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-24T19:33:56.307803+00:00 app[web.1]: npm ERR! errno 1
2018-12-24T19:33:56.308083+00:00 app[web.1]: npm ERR! [email protected] start: node index.js
2018-12-24T19:33:56.309183+00:00 app[web.1]: npm ERR! Exit status 1
2018-12-24T19:33:56.309520+00:00 app[web.1]: npm ERR!
2018-12-24T19:33:56.309872+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2018-12-24T19:33:56.310119+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-24T19:33:56.312753+00:00 app[web.1]:
2018-12-24T19:33:56.313560+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-24T19:33:56.314137+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-24T19_33_56_277Z-debug.log
2018-12-24T19:33:56.429956+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-24T19:33:56.409663+00:00 heroku[web.1]: Process exited with status 1
2018-12-24T19:34:23.816065+00:00 heroku[web.1]: Starting process with command npm start
2018-12-24T19:34:26.556079+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-24T19:34:26.518100+00:00 heroku[web.1]: Process exited with status 1
2018-12-24T19:34:30.218256+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-24T19:34:29.504972+00:00 app[api]: Release v14 created by user [email protected]
2018-12-24T19:34:29.504972+00:00 app[api]: Set GOOGLE_CLIENT_SECRET config vars by user [email protected]
2018-12-24T19:34:32.722697+00:00 heroku[web.1]: Starting process with command npm start
2018-12-24T19:34:35.197979+00:00 app[web.1]:
2018-12-24T19:34:35.197995+00:00 app[web.1]: > [email protected] start /app
2018-12-24T19:34:35.197997+00:00 app[web.1]: > node index.js
2018-12-24T19:34:35.197998+00:00 app[web.1]:
2018-12-24T19:34:36.032420+00:00 app[web.1]: module.js:487
2018-12-24T19:34:36.032459+00:00 app[web.1]: throw err;
2018-12-24T19:34:36.032461+00:00 app[web.1]: ^
2018-12-24T19:34:36.032462+00:00 app[web.1]:
2018-12-24T19:34:36.032464+00:00 app[web.1]: Error: Cannot find module './models/User'
2018-12-24T19:34:36.032466+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:485:15)
2018-12-24T19:34:36.032468+00:00 app[web.1]: at Function.Module._load (module.js:437:25)
2018-12-24T19:34:36.032469+00:00 app[web.1]: at Module.require (module.js:513:17)
2018-12-24T19:34:36.032471+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-12-24T19:34:36.032473+00:00 app[web.1]: at Object. (/app/index.js:8:1)
2018-12-24T19:34:36.032474+00:00 app[web.1]: at Module._compile (module.js:569:30)
2018-12-24T19:34:36.032476+00:00 app[web.1]: at Object.Module._extensions..js (module.js:580:10)
2018-12-24T19:34:36.032477+00:00 app[web.1]: at Module.load (module.js:503:32)
2018-12-24T19:34:36.032479+00:00 app[web.1]: at tryModuleLoad (module.js:466:12)
2018-12-24T19:34:36.032480+00:00 app[web.1]: at Function.Module._load (module.js:458:3)
2018-12-24T19:34:36.032482+00:00 app[web.1]: at Function.Module.runMain (module.js:605:10)
2018-12-24T19:34:36.032483+00:00 app[web.1]: at startup (bootstrap_node.js:158:16)
2018-12-24T19:34:36.032485+00:00 app[web.1]: at bootstrap_node.js:575:3
2018-12-24T19:34:36.047028+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-12-24T19:34:36.047400+00:00 app[web.1]: npm ERR! errno 1
2018-12-24T19:34:36.047658+00:00 app[web.1]: npm ERR! [email protected] start: node index.js
2018-12-24T19:34:36.047884+00:00 app[web.1]: npm ERR! Exit status 1
2018-12-24T19:34:36.048034+00:00 app[web.1]: npm ERR!
2018-12-24T19:34:36.048190+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2018-12-24T19:34:36.048595+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-24T19:34:36.049916+00:00 app[web.1]:
2018-12-24T19:34:36.050159+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-12-24T19:34:36.050339+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-12-24T19_34_36_043Z-debug.log
2018-12-24T19:34:36.135042+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-24T19:34:37.161578+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-bayou-54764.herokuapp.com request_id=992467d5-a879-46f4-8016-3de2d039effc fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:34:54.835244+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/auth/google" host=immense-bayou-54764.herokuapp.com request_id=27ff55e1-141e-4565-8159-e54a00a29c56 fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:35:11.906553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-bayou-54764.herokuapp.com request_id=8fdf7921-0b28-44d6-a3a8-2355a5fcfc4a fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:37:10.967226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-bayou-54764.herokuapp.com request_id=351d1a90-1106-4c81-a4cf-2e34b7308930 fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:39:17.639779+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/auth/google" host=immense-bayou-54764.herokuapp.com request_id=35ac42a7-8439-4c1c-8013-10ebce49efab fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:42:05.437492+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-bayou-54764.herokuapp.com request_id=3e483aaa-4212-4a93-9a2c-ed2be21a9205 fwd="24.247.108.2" dyno= connect= service= status=503 bytes= protocol=https
2018-12-24T19:45:01.417311+00:00 heroku[web.1]: State changed from crashed to starting
2018-12-24T19:45:05.595865+00:00 app[web.1]:
2018-12-24T19:45:05.595885+00:00 app[web.1]: > [email protected] start /app
2018-12-24T19:45:05.595887+00:00 app[web.1]: > node index.js
2018-12-24T19:45:05.595888+00:00 app[web.1]:
2018-12-24T19:45:06.208919+00:00 heroku[web.1]: State changed from starting to crashed
2018-12-24T19:45:06.190230+00:00 heroku[web.1]: Process exited with status 1


My index.js file looks like this:

const express = require('express');
const mongoose = require('mongoose');
const cookieSession = require('cookie-session');
const passport = require('passport');
const keys = require('./config/keys')
require('./models/User');
require('./services/passport');

mongoose.connect(keys.mongoURI);

const app = express();

app.use(
cookieSession({
maxAge: 30 * 24 * 60 * 60 * 1000,
keys: [keys.cookieKey]
})
);

app.use(passport.initialize());
app.use(passport.session());

require('./routes/authRoutes')(app);

const PORT = process.env.PORT || 5000;
app.listen(PORT);

Oauth2 is not redirecting in production

I've followed the tutorial until step 111 ("Testing Deployment") and build a modified version of the app. Everything is working fine in development.
But when I deploy to Heroku and then try to initiate the auth flow by clicking on the "/auth/google" link, a blanch screen appears and I'm not redirected.

Interestingly, when I use postman to make a get request at the "<heroku_url>/auth/google" endpoint, it returns the HTML and CSS of the google sign in screen.

Does anyone know how to solve this issue? I tried out everything that came to my mind

TokenError: Code was already redeemed

Hi,

Anyone else had this problem? asked on Udemy as well. I spent ages trying to find a solution.

Heres my index.js:

const express = require('express');
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;
const keys = require('./config/keys');

const app = express();

passport.use(
	new GoogleStrategy(
		{
			clientID: keys.googleClientID,
			clientSecret: keys.googleClientSecret,
			callbackURL: '/auth/google/callback'
		},
		accessToken => {
			console.log('accessToken');
		}
	)
);

app.get(
	'/auth/google',
	passport.authenticate('google', {
		scope: ['profile', 'email']  
	})
);

app.get('/auth/google/callback', passport.authenticate('google'));

const PORT = process.env.PORT || 5000;
app.listen(PORT);

Heres my terminal:

accessToken
TokenError: Code was already redeemed.
    at Strategy.OAuth2Strategy.parseErrorResponse (/Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/passport-oauth2/lib/strategy.js:329:12)
    at Strategy.OAuth2Strategy._createOAuthError (/Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/passport-oauth2/lib/strategy.js:376:16)
    at /Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/passport-oauth2/lib/strategy.js:166:45
    at /Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/oauth/lib/oauth2.js:191:18
    at passBackControl (/Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/Users/connoringold/code/killercarwash/full-stack-javascript-website/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)

Reason for this Error

(node:20132) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mongo-client
Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
undefined
(node:20132) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: User is not defined
(node:20132) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TokenError: Code was already redeemed.
at Strategy.OAuth2Strategy.parseErrorResponse (/home/chandan/server/node_modules/passport-oauth2/lib/strategy.js:329:12)
at Strategy.OAuth2Strategy._createOAuthError (/home/chandan/server/node_modules/passport-oauth2/lib/strategy.js:376:16)
at /home/chandan/server/node_modules/passport-oauth2/lib/strategy.js:166:45
at /home/chandan/server/node_modules/oauth/lib/oauth2.js:191:18
at passBackControl (/home/chandan/server/node_modules/oauth/lib/oauth2.js:132:9)
at IncomingMessage. (/home/chandan/server/node_modules/oauth/lib/oauth2.js:157:7)
at IncomingMessage.emit (events.js:164:20)
at endReadableNT (_stream_readable.js:1054:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

section :3

hello stephen,
i am getting error at googleclientsecret with unexpected identifier.
please help me with it.

UnhandledPromiseRejectionWarning: SendGridError: Response error - error when using axios to send fake survey

image

stack trace

 (node:5628) UnhandledPromiseRejectionWarning: SendGridError: Response error
[0]     at c:\react_tut\server\node_modules\sendgrid\lib\sendgrid.js:104:23
[0]     at IncomingMessage.<anonymous> (c:\react_tut\server\node_modules\sendgrid-rest\lib\client.js:112:9)
[0]     at emitNone (events.js:111:20)
[0]     at IncomingMessage.emit (events.js:208:7)
[0]     at endReadableNT (_stream_readable.js:1064:12)
[0]     at _combinedTickCallback (internal/process/next_tick.js:138:11)
[0]     at process._tickCallback (internal/process/next_tick.js:180:9)
[0] (node:5628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

did anyone have this issue when trying to send the email through axios?

SendGrid Test Integration with local tunnel not working.

Hi Stephen,

When I tried integrating sendgrid event notification with localtunnel. It doesn't seem to work.
I have tested the localtunnel proxy link seperately and it works fine. The sendgrid event notification also works fine as I tested it with an online service and I can confirm it is sending a sample POST request.

It doesn't work for complete source code of application as well.
To reproduce the problem,
checkout the testing webhooks branch.
and install the dependencies and run the server.
then in the sendgrid mail settings , Event notification paste the proxy localtunnel link and then click 'Test Your Integration'. You will see that the req.body is not getting logged in your console.

Video 53/54 - Errors in deployment

Hi Stephen,

I'm stuck at video 53/54 of your course. I have posted my question here: https://www.udemy.com/node-with-react-fullstack-web-development/learn/v4/questions/2720370

I have spent the last 12 hours goolging these issues and in relation to the errors, the best understanding I can reach is that react and heroku are incompatible in the way in which they process some parts of the code. Is that correct? If so, do you have a work around that is not currently included in the course materials?

In relation to the deprecation warnings, the MongoDB documents set out alternative ways in which to address the problems. Is there any advice on which alternative to choose?

I'm stuck. I've bought so many of these tutorials and am not getting anywhere with any of them for reasons that I just can't make any sense of. I'd love to find the grounding fundamentals course that would give me something to work with when these problems arise.

Thank you in advance.

heroku open
MacBook-Pro:cf mm$ heroku logs
2017-08-20T22:43:40.596085+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx-.herokuapp.com request_id=xxx  fwd="202.191.1.40" dyno=web.1 connect=0ms service=3ms status=302 bytes=389 protocol=https
2017-08-20T22:54:06.000000+00:00 app[api]: Build started by user [email protected]
2017-08-20T22:54:19.091802+00:00 heroku[web.1]: Restarting
2017-08-20T22:54:19.091802+00:00 heroku[web.1]: State changed from up to starting
2017-08-20T22:54:18.831121+00:00 app[api]: Deploy da8d8b92 by user [email protected]
2017-08-20T22:54:18.831121+00:00 app[api]: Release v11 created by user [email protected]
2017-08-20T22:54:06.000000+00:00 app[api]: Build succeeded
2017-08-20T22:54:19.688562+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2017-08-20T22:54:19.649237+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-20T22:54:19.760418+00:00 heroku[web.1]: Process exited with status 22
2017-08-20T22:54:20.680662+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-20T22:54:23.109022+00:00 app[web.1]: > [email protected] start /app
2017-08-20T22:54:23.109023+00:00 app[web.1]: > node index.js
2017-08-20T22:54:23.109002+00:00 app[web.1]: 
2017-08-20T22:54:23.109023+00:00 app[web.1]: 
2017-08-20T22:54:23.653124+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-20T22:54:23.677395+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-20T22:54:24.282097+00:00 heroku[web.1]: State changed from starting to up
2017-08-20T22:54:28.023299+00:00 heroku[router]: at=info method=GET path="/" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=0ms service=16ms status=404 bytes=383 protocol=https
2017-08-20T22:54:34.447414+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=5ms status=302 bytes=390 protocol=https
2017-08-20T22:54:34.873730+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=3ms status=302 bytes=390 protocol=https
2017-08-20T22:54:57.205162+00:00 heroku[router]: at=info method=GET path="/auth/google/callback?code=4/NHpaYlY-zJDmeXsmDyNWLYH4gzZbrB9BYlXckQcO3gE" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=877ms status=404 bytes=666 protocol=https
2017-08-20T22:54:57.136700+00:00 app[web.1]: (node:17) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: ://mongoosejs.com/docs/promises.html
2017-08-20T22:55:13.781475+00:00 heroku[router]: at=info method=GET path="/api/current_user" host=xxx.herokuapp.com request_id=8d83bd4f-f941-47c0-a8fa-d13f37054f4d fwd="202.191.1.40" dyno=web.1 connect=1ms service=12ms status=200 bytes=284 protocol=https
2017-08-20T23:30:39.073527+00:00 heroku[web.1]: Idling
2017-08-20T23:30:39.074206+00:00 heroku[web.1]: State changed from up to down
2017-08-20T23:30:39.530685+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-20T23:30:39.599337+00:00 heroku[web.1]: Process exited with status 143
2017-08-21T00:41:03.000000+00:00 app[api]: Build started by user [email protected]
2017-08-21T00:41:03.000000+00:00 app[api]: Build failed -- check your build logs
2017-08-21T00:41:57.000000+00:00 app[api]: Build started by user [email protected]
2017-08-21T00:42:10.723166+00:00 app[api]: Release v12 created by user [email protected]
2017-08-21T00:42:10.723166+00:00 app[api]: Deploy 8c377296 by user [email protected]
2017-08-21T00:41:57.000000+00:00 app[api]: Build succeeded
2017-08-21T00:42:11.559452+00:00 heroku[web.1]: State changed from down to starting
2017-08-21T00:42:13.579690+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-21T00:42:16.699529+00:00 app[web.1]: 
2017-08-21T00:42:16.699542+00:00 app[web.1]: > [email protected] start /app
2017-08-21T00:42:16.699543+00:00 app[web.1]: 
2017-08-21T00:42:16.780417+00:00 app[web.1]: module.js:487
2017-08-21T00:42:16.780419+00:00 app[web.1]:     throw err;
2017-08-21T00:42:16.780419+00:00 app[web.1]:     ^
2017-08-21T00:42:16.699543+00:00 app[web.1]: > node index.js
2017-08-21T00:42:16.780420+00:00 app[web.1]: 
2017-08-21T00:42:16.780421+00:00 app[web.1]: Error: Cannot find module 'express'
2017-08-21T00:42:16.780422+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:485:15)
2017-08-21T00:42:16.780422+00:00 app[web.1]:     at Function.Module._load (module.js:437:25)
2017-08-21T00:42:16.780423+00:00 app[web.1]:     at Module.require (module.js:513:17)
2017-08-21T00:42:16.780424+00:00 app[web.1]:     at require (internal/module.js:11:18)
2017-08-21T00:42:16.780424+00:00 app[web.1]:     at Object.<anonymous> (/app/index.js:1:79)
2017-08-21T00:42:16.780425+00:00 app[web.1]:     at Module._compile (module.js:569:30)
2017-08-21T00:42:16.780425+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:580:10)
2017-08-21T00:42:16.780426+00:00 app[web.1]:     at Module.load (module.js:503:32)
2017-08-21T00:42:16.780427+00:00 app[web.1]:     at tryModuleLoad (module.js:466:12)
2017-08-21T00:42:16.780427+00:00 app[web.1]:     at Function.Module._load (module.js:458:3)
2017-08-21T00:42:16.822911+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-08-21T00:42:16.823143+00:00 app[web.1]: npm ERR! errno 1
2017-08-21T00:42:16.823290+00:00 app[web.1]: npm ERR! [email protected] start: `node index.js`
2017-08-21T00:42:16.823396+00:00 app[web.1]: npm ERR! Exit status 1
2017-08-21T00:42:16.823479+00:00 app[web.1]: npm ERR! 
2017-08-21T00:42:16.823578+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2017-08-21T00:42:16.823659+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-08-21T00:42:16.825226+00:00 app[web.1]: 
2017-08-21T00:42:16.825441+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-08-21T00:42:16.825537+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2017-08-21T00_42_16_788Z-debug.log
2017-08-21T00:42:16.928117+00:00 heroku[web.1]: State changed from starting to crashed
2017-08-21T00:42:16.929881+00:00 heroku[web.1]: State changed from crashed to starting
2017-08-21T00:42:16.918763+00:00 heroku[web.1]: Process exited with status 1
2017-08-21T00:42:19.139547+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-21T00:42:22.508755+00:00 heroku[web.1]: Process exited with status 1
2017-08-21T00:42:22.294142+00:00 app[web.1]: 
2017-08-21T00:42:22.401167+00:00 app[web.1]: Error: Cannot find module 'express'
2017-08-21T00:42:22.401165+00:00 app[web.1]:     throw err;
2017-08-21T00:42:22.401166+00:00 app[web.1]:     ^
2017-08-21T00:42:22.294161+00:00 app[web.1]: > node index.js
2017-08-21T00:42:22.294162+00:00 app[web.1]: 
2017-08-21T00:42:22.294160+00:00 app[web.1]: > [email protected] start /app
2017-08-21T00:42:22.401166+00:00 app[web.1]: 
2017-08-21T00:42:22.401168+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:485:15)
2017-08-21T00:42:22.401169+00:00 app[web.1]:     at Function.Module._load (module.js:437:25)
2017-08-21T00:42:22.401170+00:00 app[web.1]:     at require (internal/module.js:11:18)
2017-08-21T00:42:22.401172+00:00 app[web.1]:     at Module.load (module.js:503:32)
2017-08-21T00:42:22.401163+00:00 app[web.1]: module.js:487
2017-08-21T00:42:22.401171+00:00 app[web.1]:     at Module._compile (module.js:569:30)
2017-08-21T00:42:22.401170+00:00 app[web.1]:     at Object.<anonymous> (/app/index.js:1:79)
2017-08-21T00:42:22.401169+00:00 app[web.1]:     at Module.require (module.js:513:17)
2017-08-21T00:42:22.401172+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:580:10)
2017-08-21T00:42:22.401173+00:00 app[web.1]:     at tryModuleLoad (module.js:466:12)
2017-08-21T00:42:22.417939+00:00 app[web.1]: npm ERR! errno 1
2017-08-21T00:42:22.418688+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-08-21T00:42:22.417716+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-08-21T00:42:22.401173+00:00 app[web.1]:     at Function.Module._load (module.js:458:3)
2017-08-21T00:42:22.420013+00:00 app[web.1]: 
2017-08-21T00:42:22.420279+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-08-21T00:42:22.420383+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2017-08-21T00_42_22_411Z-debug.log
2017-08-21T00:42:22.418095+00:00 app[web.1]: npm ERR! [email protected] start: `node index.js`
2017-08-21T00:42:22.418216+00:00 app[web.1]: npm ERR! Exit status 1
2017-08-21T00:42:22.418357+00:00 app[web.1]: npm ERR! 
2017-08-21T00:42:22.418560+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2017-08-21T00:42:22.521212+00:00 heroku[web.1]: State changed from starting to crashed
2017-08-21T00:42:29.122886+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno= connect= service= status=503 bytes= protocol=https

Mongoose and Promise Error

Issue 1:
[0] (node:3752) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 5 to cluster0-shard-00-02-bioze.mongodb.net:27017 closed
[0] at TLSSocket. (E:\Home\server\node_modules\mongodb-core\lib\connection\connection.js:352:9)
[0] at Object.onceWrapper (events.js:277:13)
[0] at TLSSocket.emit (events.js:189:13)
[0] at _handle.close (net.js:597:12)
[0] at TCP.done (_tls_wrap.js:388:7)
[0] (node:3752) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

Issue 2:
[1] When specified, "proxy" in package.json must be a string.
[1] Instead, the type of "proxy" was "object".
[1] Either remove "proxy" from package.json, or make it a string.
[1] npm ERR! code ELIFECYCLE
npm ERR! errno 1
[1] npm ERR! [email protected] start: react-scripts start
[1] npm ERR! Exit status 1
[1] npm ERR!
npm ERR! Failed at the [email protected] start script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! C:\Users\Samsung user\AppData\Roaming\npm-cache_logs\2019-06-11T06_44_18_943Z-debug.log
[1] npm ERR! code ELIFECYCLE
npm ERR! errno 1
[1] npm ERR! [email protected] client: npm run start --prefix client
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the [email protected] client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Samsung user\AppData\Roaming\npm-cache_logs\2019-06-11T06_44_18_975Z-debug.log
[1] npm run client exited with code 1

I found a post on stackoverflow solution regarding the proxy issue, that says to create a separate setupProxy.js file and apply proxy in below way
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use(proxy('/auth/google',
{ target: 'http://localhost:5000' },
"/api/*", {
"target": "http://localhost:5000"
}
));
}
and delete the proxy from client/package.json,
But this remains a temprory solution, and often the error appears regular

Issue 3:
http://localhost:5000/api/current_user
the page remains totally blank, no current user is shown

TokkenError: Bad Request

THIS IS MY CODE:
`const express = require('express') ;
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy
const keys = require('./config/keys');

const app = express();

passport.use(new GoogleStrategy({
clientID: keys.googleClientID,
clientSecret: keys.googleClientSecret,
callbackURL:'/auth/google/callback'
}, (accessToken, refreshToken, profile, done) => {
console.log('accessToken', accessToken);
console.log('refreshToken', refreshToken);
console.log('profile', profile);
})
);

app.get('/auth/google', passport.authenticate('google', {
scope:['profile','email']
}));

app.get('/auth/google/callback', passport.authenticate('google'));

const PORT = process.env.PORT || 5000;
app.listen(PORT);

===================================================================

ERROR : ekpo eddy@EDDY MINGW64 ~/Desktop/nodeproject/server (master)
$ node index.js
accessToken ya29.GltlBkOxTgYv2Usrc-uZ30FcYEz6kjEpSoJMWTZiRlFgQs1MMdTqyMCEQggFFJD
QwRPnRmtDrDpvsIVfSD824t6Ux40gnJpXP2B-RRKIWUYIMlQPNq0934adRJKm
refreshToken undefined
profile { id: '115683550688654773269',
displayName: 'Edet Ekpo',
name: { familyName: 'Ekpo', givenName: 'Edet' },
emails: [ { value: '[email protected]', type: 'account' } ],
photos:
[ { value:
'https://lh5.googleusercontent.com/-_W9wyfmpojs/AAAAAAAAAAI/AAAAAAAAAB0/
tpQ0uHFeRWA/photo.jpg?sz=50' } ],
gender: undefined,
provider: 'google',
_raw:
'{\n "kind": "plus#person",\n "etag": "\"jb1Xzanox6i8Zyse4DcYD8sZqy0/O1bz5ZX
VnfSXOnS8IimFT_xk7GE\"",\n "emails": [\n {\n "value": "[email protected]
m",\n "type": "account"\n }\n ],\n "objectType": "person",\n "id": "115683550
688654773269",\n "displayName": "Edet Ekpo",\n "name": {\n "familyName": "Ekpo"
,\n "givenName": "Edet"\n },\n "url": "https://plus.google.com/1156835506886547
73269",\n "image": {\n "url": "https://lh5.googleusercontent.com/-_W9wyfmpojs/A
AAAAAAAAAI/AAAAAAAAAB0/tpQ0uHFeRWA/photo.jpg?sz=50",\n "isDefault": false\n },
n "isPlusUser": true,\n "language": "en",\n "circledByCount": 0,\n "verified": f
alse\n}\n',
_json:
{ kind: 'plus#person',
etag: '"jb1Xzanox6i8Zyse4DcYD8sZqy0/O1bz5ZXVnfSXOnS8IimFT_xk7GE"',
emails: [ { value: '[email protected]', type: 'account' } ],
objectType: 'person',
id: '115683550688654773269',
displayName: 'Edet Ekpo',
name: { familyName: 'Ekpo', givenName: 'Edet' },
url: 'https://plus.google.com/115683550688654773269',
image:
{ url:
'https://lh5.googleusercontent.com/-_W9wyfmpojs/AAAAAAAAAAI/AAAAAAAAAB0
/tpQ0uHFeRWA/photo.jpg?sz=50',
isDefault: false },
isPlusUser: true,
language: 'en',
circledByCount: 0,
verified: false } }
accessToken ya29.GltlBjdmG2SjB9GrRxrV0C7Ax66aWndCN0cAiNbb2uigQaYtfnYNvdtae1DK41f
lEkgbe4257OUh4mbGNRxeNfSNR-WXf2WkNt635jakrIXAUQslddWnammL3ERk
refreshToken undefined
profile { id: '115683550688654773269',
displayName: 'Edet Ekpo',
name: { familyName: 'Ekpo', givenName: 'Edet' },
emails: [ { value: '[email protected]', type: 'account' } ],
photos:
[ { value:
'https://lh5.googleusercontent.com/-_W9wyfmpojs/AAAAAAAAAAI/AAAAAAAAAB0/
tpQ0uHFeRWA/photo.jpg?sz=50' } ],
gender: undefined,
provider: 'google',
_raw:
'{\n "kind": "plus#person",\n "etag": "\"jb1Xzanox6i8Zyse4DcYD8sZqy0/O1bz5ZX
VnfSXOnS8IimFT_xk7GE\"",\n "emails": [\n {\n "value": "[email protected]
m",\n "type": "account"\n }\n ],\n "objectType": "person",\n "id": "115683550
688654773269",\n "displayName": "Edet Ekpo",\n "name": {\n "familyName": "Ekpo"
,\n "givenName": "Edet"\n },\n "url": "https://plus.google.com/1156835506886547
73269",\n "image": {\n "url": "https://lh5.googleusercontent.com/-_W9wyfmpojs/A
AAAAAAAAAI/AAAAAAAAAB0/tpQ0uHFeRWA/photo.jpg?sz=50",\n "isDefault": false\n },
n "isPlusUser": true,\n "language": "en",\n "circledByCount": 0,\n "verified": f
alse\n}\n',
_json:
{ kind: 'plus#person',
etag: '"jb1Xzanox6i8Zyse4DcYD8sZqy0/O1bz5ZXVnfSXOnS8IimFT_xk7GE"',
emails: [ { value: '[email protected]', type: 'account' } ],
objectType: 'person',
id: '115683550688654773269',
displayName: 'Edet Ekpo',
name: { familyName: 'Ekpo', givenName: 'Edet' },
url: 'https://plus.google.com/115683550688654773269',
image:
{ url:
'https://lh5.googleusercontent.com/-_W9wyfmpojs/AAAAAAAAAAI/AAAAAAAAAB0
/tpQ0uHFeRWA/photo.jpg?sz=50',
isDefault: false },
isPlusUser: true,
language: 'en',
circledByCount: 0,
verified: false } }
TokenError: Bad Request
at Strategy.OAuth2Strategy.parseErrorResponse (C:\Users\ekpo eddy\Desktop\no
deproject\node_modules\passport-oauth2\lib\strategy.js:329:12)
at Strategy.OAuth2Strategy.createOAuthError (C:\Users\ekpo eddy\Desktop\nod
eproject\node_modules\passport-oauth2\lib\strategy.js:376:16)
at C:\Users\ekpo eddy\Desktop\nodeproject\node_modules\passport-oauth2\lib\s
trategy.js:166:45
at C:\Users\ekpo eddy\Desktop\nodeproject\node_modules\oauth\lib\oauth2.js:1
91:18
at passBackControl (C:\Users\ekpo eddy\Desktop\nodeproject\node_modules\oaut
h\lib\oauth2.js:132:9)
at IncomingMessage. (C:\Users\ekpo eddy\Desktop\nodeproject\node

modules\oauth\lib\oauth2.js:157:7)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1098:12)
at process.internalTickCallback (internal/process/next_tick.js:72:19)

`

Got this error while working on the log out thing

$ npm run dev

[email protected] dev D:\workspace\server1
nodemon index.js

[nodemon] 1.18.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node index.js
(node:13260) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
events.js:167
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::5000
at Server.setupListenHandle [as _listen2] (net.js:1328:14)
at listenInCluster (net.js:1376:12)
at Server.listen (net.js:1463:7)
at Function.listen (D:\workspace\server1\node_modules\express\lib\application.js:618:24)
at Object. (D:\workspace\server1\index.js:25:5)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:240:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1355:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:746:11)
at startup (internal/bootstrap/node.js:240:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)
[nodemon] app crashed - waiting for file changes before starting...

Heroku Application error

2019-01-15T15:22:25.802182+00:00 app[web.1]: npm ERR! 2019-01-15T15:22:25.802484+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script. 2019-01-15T15:22:25.803024+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-01-15T15:22:25.806344+00:00 app[web.1]: 2019-01-15T15:22:25.807126+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-01-15T15:22:25.807593+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-01-15T15_22_25_785Z-debug.log 2019-01-15T15:22:25.923155+00:00 heroku[web.1]: State changed from starting to crashed 2019-01-15T15:22:25.929275+00:00 heroku[web.1]: State changed from crashed to starting 2019-01-15T15:22:25.900280+00:00 heroku[web.1]: Process exited with status 1 2019-01-15T15:22:42.093248+00:00 heroku[web.1]: Starting process with command npm start 2019-01-15T15:22:46.266923+00:00 app[web.1]: module.js:487 2019-01-15T15:22:46.266957+00:00 app[web.1]: throw err; 2019-01-15T15:22:46.266959+00:00 app[web.1]: ^ 2019-01-15T15:22:46.266961+00:00 app[web.1]: 2019-01-15T15:22:46.266963+00:00 app[web.1]: Error: Cannot find module 'passport' 2019-01-15T15:22:46.266965+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:485:15) 2019-01-15T15:22:46.266967+00:00 app[web.1]: at Function.Module._load (module.js:437:25) 2019-01-15T15:22:46.266968+00:00 app[web.1]: at Module.require (module.js:513:17) 2019-01-15T15:22:46.266970+00:00 app[web.1]: at require (internal/module.js:11:18) 2019-01-15T15:22:46.266972+00:00 app[web.1]: at Object. (/app/index.js:4:18) 2019-01-15T15:22:46.266973+00:00 app[web.1]: at Module._compile (module.js:569:30) 2019-01-15T15:22:46.266975+00:00 app[web.1]: at Object.Module._extensions..js (module.js:580:10) 2019-01-15T15:22:46.266976+00:00 app[web.1]: at Module.load (module.js:503:32) 2019-01-15T15:22:46.266978+00:00 app[web.1]: at tryModuleLoad (module.js:466:12) 2019-01-15T15:22:46.266979+00:00 app[web.1]: at Function.Module._load (module.js:458:3) 2019-01-15T15:22:46.266981+00:00 app[web.1]: at Function.Module.runMain (module.js:605:10) 2019-01-15T15:22:46.266982+00:00 app[web.1]: at startup (bootstrap_node.js:158:16) 2019-01-15T15:22:46.266984+00:00 app[web.1]: at bootstrap_node.js:575:3 2019-01-15T15:22:46.303537+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2019-01-15T15:22:46.304326+00:00 app[web.1]: npm ERR! errno 1 2019-01-15T15:22:46.305039+00:00 app[web.1]: npm ERR! [email protected] start: node index.js 2019-01-15T15:22:46.305434+00:00 app[web.1]: npm ERR! Exit status 1 2019-01-15T15:22:46.305908+00:00 app[web.1]: npm ERR! 2019-01-15T15:22:46.306343+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script. 2019-01-15T15:22:46.306916+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2019-01-15T15:22:46.310663+00:00 app[web.1]: 2019-01-15T15:22:46.311505+00:00 app[web.1]: npm ERR! A complete log of this run can be found in: 2019-01-15T15:22:46.311679+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-01-15T15_22_46_289Z-debug.log 2019-01-15T15:22:46.413514+00:00 heroku[web.1]: Process exited with status 1 2019-01-15T15:22:56.003574+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-fjord-71188.herokuapp.com request_id=fc83f5dc-d4c1-4f32-853f-395dee5ea663 fwd="41.217.117. 212" dyno= connect= service= status=503 bytes= protocol=https 2019-01-15T15:24:36.386551+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-fjord-71188.herokuapp.com request_id=a356786a-9533-4b4d-8a38-9d85c1db99a7 fwd="41.217.117. 212" dyno= connect= service= status=503 bytes= protocol=https 2019-01-15T15:24:37.232472+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tranquil-fjord-71188.herokuapp.com request_id=03f848f9-6cda-4456-910f-41921e36b41b fwd=" 41.217.117.212" dyno= connect= service= status=503 bytes= protocol=https 2019-01-15T15:44:07.594452+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-fjord-71188.herokuapp.com request_id=db49ca9b-c24c-47b9-bda3-58efb9807933 fwd="41.217.117. 212" dyno= connect= service= status=503 bytes= protocol=https 2019-01-15T15:44:08.427847+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tranquil-fjord-71188.herokuapp.com request_id=1efeeb4c-429e-436b-b010-aba258ba314b fwd=" 41.217.117.212" dyno= connect= service= status=503 bytes= protocol=https

===================================================================

2019-01-15T15:46:25.526334+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2019-01-15T15:46:25.526425+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-01-15T15:46:25.527386+00:00 app[web.1]:
2019-01-15T15:46:25.527512+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-01-15T15:46:25.527568+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-01-15T15_46_25_520Z-debug.log
2019-01-15T15:46:25.603526+00:00 heroku[web.1]: State changed from starting to crashed
2019-01-15T15:46:25.576924+00:00 heroku[web.1]: Process exited with status 1
2019-01-15T16:10:08.204841+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-fjord-71188.herokuapp.com request_id=75f88daa-4791-462b-9f0e-4c029e203ff4 fwd="197.255.170.189" dyno= connect= service= status=503 bytes= protocol=https
2019-01-15T16:10:08.946361+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tranquil-fjord-71188.herokuapp.com request_id=c095d312-bf4f-46e3-b7c1-4905269ba67f fwd="197.255.170.189" dyno= connect= service= status=503 bytes= protocol=https
2019-01-15T16:19:20.341707+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-fjord-71188.herokuapp.com request_id=901d485f-d451-4790-98de-7c9545e721b3 fwd="197.255.170.189" dyno= connect= service= status=503 bytes= protocol=https

Problem accessing React App Nginx proxy

Hi,
I wrote the application like you outline on the course, I want to make it reachable as application deployed on a Web Nginx server, the application have a link at Reat App. To do this I configured an reverse proxy inside Nginx. My problem is the when I call the Node/React app by the link I only see a white page, all works perfectly in the Browser if I call the Node/React app directly.
See below:

package.json (server)

{ "name": "server", "version": "1.0.0", "description": "", "main": "index.js", "engines": { "node": "9.8.0", "npm": "6.0.0" }, "scripts": { "start": "node index.js", "server": "nodemon index.js", "client": "npm run start --prefix client", "dev": "concurrently \"npm run start\" \"npm run client\"" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.16.3", "mongoose": "^5.1.4", "nodemon": "^1.17.5" } }

index.js (server)

`const express = require("express");
const app = express();
const keys = require('./config/Keys');
const mongoose = require("mongoose");
require('./models/User');
require('./models/Profile');
mongoose.connect(keys.mongoURI);
const User = mongoose.model('users');

app.use(express.static('client/build'));
const path = require('path');
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname,'client', 'build', 'index.html'));
}); `

package.json (client)
{ "name": "client", "version": "0.1.0", "private": true, "homepage": ".", "proxy": { "/api/*": { "target": "http://localhost:5000" } }, "dependencies": { "react": "^16.4.0", "react-dom": "^16.4.0", "react-redux": "^5.0.7", "react-router-dom": "^4.3.1", "react-scripts": "1.1.4", "redux": "^4.0.0" }, "scripts": { "start": "set HTTPS=true&&react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } }

index.js (client)

`import materializeCSS from 'materialize-css/dist/css/materialize.min.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import reduxThunk from 'redux-thunk';

import App from './components/App';
const store = createStore(() => [], {}, applyMiddleware(reduxThunk));

ReactDOM.render(
,
document.querySelector('#root'));
`

Nginix reverse proxy

`location /react {

            proxy_pass http://10.30.1.185:5000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }`

screenshot from 2018-06-08 15-04-59

screenshot from 2018-06-08 15-05-16

In the Browswer console I get the following warning:

Loading failed for the <script> with source โ€œhttps://xxxxxxxx/static/js/main.cfe29440.jsโ€.

Any thoughts why I am getting just a white page?

Repeated Authentication

server.zip
I have to login everytime i open a new tag and navigate to the localhost:5000/auth/callback unlike stephen who finds his account already logged in after the first time? Is that a problem? rest is going good.

S10, L134: POST http://localhost:3000/api/surveys net::ERR_EMPTY_RESPONSE

Seems like there is an error in the repo code as well as many others reporting the same issue trying to send emails.

Course Q&A: POST http://localhost:3000/api/surveys net::ERR_EMPTY_RESPONSE

Pulling from Branch 132 Testing Emails

I was having this issue in my code as well. Typically errors in my code is from a typo, so to fix this I do blanket copy and pastes from the repo into my code until I can pinpoint my error. After doing this I was still seeing the same error. Because I was seeing the same error it was time to pull down the repo and see if the actual course base code is broken. After pulling down, checking out Branch #132, and setting up Axios on the window, the error still persists.

Proxy

The way of adding proxys has changed. It no longer has to be added to package.json, but to a file named setupProxy.js inside src of client. Also, 'http-proxy-middleware' has to be installed.

Code inside setupProxy would look like this -

const proxy = require('http-proxy-middleware')
 
module.exports = function(app) {
  app.use(proxy('/auth/google', { target: 'http://localhost:5000/' }))
  app.use(proxy('/api/*', { target: 'http://localhost:5000/' }))
}

Mongoose Warnings

I took your complete mongodb course recently and when I got the warnings I found out it wants the useMongoClient parameter to be used now.

mongoose.connect(keys.mongoURI, { useMongoClient: true, });

So that should get ride of the deprecated warning. I love you courses by the way.

I can't create sand grid account

Hey Stephen,

I have concern creating sand grid account. Thay just don't let to use them services. What should I do about it to continue with this course?

Kind regards,
Deivis

Failed prop type: Invalid prop `component`

Hii Sir ,
When I loading my page in development mode it shows an error like this,

Warning: Failed prop type: Invalid prop component of type object supplied to Route, expected function.
in Route (at App.js:24)
in App (created by Context.Consumer)
in Connect(App) (at src/index.js:18)
in Provider (at src/index.js:18)

But In production its not show an error.I have check a lot of times.But I can't fix this error.
Mail is also not send both in production and development mode.
Please help me to fix

And my git Repository link : https://gitlab.com/BalaRajendran/emaily

screenshot 140

Cannot create Heroku account.

I have created account.When it gets to a point to Login after that,I keep getting error message.i have tried to reset password.
heroku

Password reset page on Heroku is not responsive.

google domain registry

When trying to generate new google id and secrete key for production which is for the domain --herokuapp.com google asks for domain registration.

I there any one who has solved this issue?

Cannot see updated collection in mlabs

I did everything the same way as he says but I can't see the collection getting updated after the /auth/google call. don't know why its' not happening

Application error

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 [email protected]
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 [email protected]
2019-05-22T23:23:12.040681+00:00 app[api]: Release v51 created by user [email protected]
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]: > [email protected] 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! [email protected] 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 [email protected] 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]: > [email protected] 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! [email protected] 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 [email protected] 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

Can't find my typo or idk what's wrong

here is my github to this project
https://github.com/TheTurok/serverReact

here is my error message

[1] > [email protected] start C:\Users\airok\Documents\GitHub\server\client

[1] > react-scripts start

[1]

[0] C:\Users\airok\Documents\GitHub\server\node_modules\express\lib\router\route.js:202

[0] throw new Error(msg);

[0] ^

[0]

[0] Error: Route.post() requires a callback function but got a [object String]

[0] at Route.(anonymous function) [as post] (C:\Users\airok\Documents\GitHub\server\node_modules\express\lib\router\route.js:202:15)

[0] at Function.app.(anonymous function) [as post] (C:\Users\airok\Documents\GitHub\server\node_modules\express\lib\application.js:482:19)

[0] at module.exports (C:\Users\airok\Documents\GitHub\server\routes\surveyRoutes.js:8:7)

[0] at Object. (C:\Users\airok\Documents\GitHub\server\index.js:35:33)

[0] at Module._compile (internal/modules/cjs/loader.js:707:30)

[0] at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)

[0] at Module.load (internal/modules/cjs/loader.js:605:32)

[0] at tryModuleLoad (internal/modules/cjs/loader.js:544:12)

[0] at Function.Module._load (internal/modules/cjs/loader.js:536:3)

[0] at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)

[0] at startup (internal/bootstrap/node.js:303:19)

[0] at bootstrapNodeJSCore (internal/bootstrap/node.js:872:3)

[0] [nodemon] app crashed - waiting for file changes before starting...

[1] [HPM] Proxy created: /auth/google -> http://localhost:5000

[1] [HPM] Proxy created: /api/* -> http://localhost:5000

[1] Starting the development server...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.