facebook-messenger-clone icon indicating copy to clipboard operation
facebook-messenger-clone copied to clipboard

Error when trying to connect user

Open jhaabdev opened this issue 3 years ago • 1 comments

I was getting the following error with my code and still do after cloning your repository.

Uncaught (in promise) Error: {"code":2,"StatusCode":401,"message":"WS failed with code 2 and reason - Connect failed with error: \"api_key not valid\"","isWSFailure":false} at StableWSConnection2._callee$ (connection.ts:125:15) at tryCatch (regeneratorRuntime.js:44:17) at Generator.<anonymous> (regeneratorRuntime.js:125:22) at Generator.throw (regeneratorRuntime.js:69:21) at asyncGeneratorStep (asyncToGenerator.js:3:23) at _throw (asyncToGenerator.js:25:9)

I believe the error happens when trying to connect the user, i.e. in client/src/context/AuthContext.tsx with the command below const connectPromise = chat.connectUser(user, token).then(() => { if (isInterrupted) return; setStreamChat(chat); })

Maybe you will know what goes wrong here?

jhaabdev avatar Jan 30 '23 14:01 jhaabdev

Hello Sorry for the late reply, unfortunately, I just checked GitHub and saw your issue I will check and let you know as soon as possible

mamalli11 avatar Jan 21 '24 01:01 mamalli11