EQuimper / twitter-clone-with-graphql-reactnative

164 stars 71 forks source link

Unhandled Error (in react-apollo) EP 14 #49

Closed MohammedBm closed 5 years ago

MohammedBm commented 6 years ago

Today i tried to continue working on the project form episode 14, but im getting a weird error

image

Here is the log i get on my expo side

Unhandled (in react-apollo) ApolloError@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:99539:36
currentResult@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:99669:44
dataForChild@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:84512:79
render@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:84563:49
measureLifeCyclePerf@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21892:18
_renderValidatedComponentWithoutOwnerOrContext@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22135:54
_renderValidatedComponent@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22144:86
_updateRenderedComponent@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22107:65
_performComponentUpdate@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22094:332
updateComponent@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22069:317
performUpdateIfNecessary@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:22036:225
performUpdateIfNecessary@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21620:202
runBatchedUpdates@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21754:51
perform@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21660:99
perform@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21660:99
flushBatchedUpdates@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21761:28
flushBatchedUpdates@[native code]
closeAll@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21691:101
perform@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21665:52
enqueueUpdate$1@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21766:107
enqueueUpdate@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21796:33
enqueueForceUpdate@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:21820:342
forceUpdate@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:18512:34
forceRenderChildren@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:84483:58
next@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:84458:50
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:99901:38
forEach@[native code]
error@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:99899:44
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:100643:47
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:101107:37
forEach@[native code]
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:101104:38
forEach@[native code]
broadcastQueries@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:101101:53
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:101046:51
tryCallOne@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:11311:14
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:11397:25
callTimer@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2284:17
callImmediatesPass@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2373:36
callImmediates@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2384:48
__callImmediates@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2152:39
http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2042:32
__guard@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2141:11
flushedQueue@http://localhost:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/mohammedbamhraz/Projects/twitter-clone/mobile/node_modules/expo/tools/hashAssetFiles:2041:19
flushedQueue@[native code]
callFunctionReturnFlushedQueue@[native code]

Here is the error on graphQL side

Mongoose: users.findOne({ _id: ObjectId("5a1b71d68ea9880550139b94") }, { fields: {} })
Mongoose: users.findOne({ _id: ObjectId("5a1b71d68ea9880550139b94") }, { fields: {} })
Error: Unauthorized!
    at /Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:14:11
    at Generator.next (<anonymous>)
    at step (/Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:44:191)
    at /Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:44:361
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:208:7)
Error: Unauthorized!
    at /Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:14:11
    at Generator.next (<anonymous>)
    at step (/Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:44:191)
    at /Users/mohammedbamhraz/Projects/twitter-clone/server/src/services/auth.js:44:361
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:208:7)
dannjoku1 commented 6 years ago

I have the same issue :(

EQuimper commented 6 years ago

Umh look like the error is about authentication. The token look invalid or maybe you forget Bearer in the string ?

dannjoku1 commented 6 years ago

I figured it out. Looks like I had a typo in the getTweets.js file

EQuimper commented 6 years ago

Nice :) Let me know if you get any other trouble :)