Amplify-js: TypeError: cannot read property 'USER_ID_FOR_SRP' of undefined. SignIn problems. React-Native Android

Created on 13 Sep 2019  路  8Comments  路  Source: aws-amplify/amplify-js

Describing the Issue
After switching to Amplify from cognito-js ive come across a problem thats been very tricky for my level. i finshed setting up all the Auth. methods (signup, signin, forgetpassword, send code, ...). i managed to get the signup sequence working without a hitch. but the problem is with SignIn. when i enter the username and password, i get and error saying ComputeModPow of undefined.After looking at the issues raised against it on here and doing the workarounds suggested, which are that i install amazon-cognito-identity-js, link it and build and run again. upon doing this i come to my issue "USER_ID_FOR_SRP" originating from CognitoUser.js: 270,

TypeError: Cannot read property 'USER_ID_FOR_SRP' of undefined
    at CognitoUser.js:270
    at Client.js:55
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:289
    at _callTimer (JSTimers.js:146)
    at _callImmediatesPass (JSTimers.js:194)
    at Object.callImmediates (JSTimers.js:458)
    at MessageQueue.__callImmediates (MessageQueue.js:366)
    at MessageQueue.js:135 "error"

To Reproduce
i tired to see if this was an issue and created a brand new npx react-native init today and it gave me the ComputeModPow error and was fixed after i installed amazon-cognito-identity-js.

so my bigbrain guess is its an issue with my project. so i request anyone to help me to figure it out.
Which versions of Amplify, and which browser / OS are affected by this issue?

    "amazon-cognito-identity-js": "^3.0.15",
    "aws-amplify": "^1.1.40",
    "aws-amplify-react-native": "^2.1.19",
    "npm": "6.10.2",
    "react": "16.8.6",
    "react-native": "0.60.5",

OS and Browser arent affected i think becasuse on a barbones react-native app this worked the was it was supposed to.

P.S my first issue and ive tried to understand the guidelines to post here. Sorry

OAuth React Native pending-close-response-required question

Most helpful comment

Facing this issue happen when running and debugging with react-native-debugger

All 8 comments

Hello @elorzafe shouldn't this have an Auth tag also?

Facing this issue happen when running and debugging with react-native-debugger

Holy, turning the debug mode off did indeed fix this error.

Same error with "Network inspector" enabled on react-native-debugger.

if you guys are using react-native-debugger with code

global.XMLHttpRequest = global.originalXMLHttpRequest
  ? global.originalXMLHttpRequest
  : global.XMLHttpRequest

in the App.js or index.js for inspecting network.

Here is the solution ---------

try remove that code in the App.js or index.js and inspecting network by right click on the diff tab on react-native-debugger screen, then choose enable network inspect instead.

@gastzars when you do that on react-natie-debugger, it injects that global reassignment so the effect is the same.
I have tried both alternatives and, in my case, the result is the same :(

Hello - picking up this issue? Is anyone still experiencing issues?

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

Was this page helpful?
0 / 5 - 0 ratings