With React Native 0.60.0, Auth.signIn returns error, but signUp, and confirmSignUp works
See original GitHub issueDescribe the bug
On a fresh new react-native 0.60.0 project
I am able to get Auth.signUp
, and Auth.confirmSignUp
to work as expected. When I try Auth.SignIn
, I get this error: TypeError: Cannot read property 'computeModPow' of undefined
.
Attempted Solution 1: Automatically Linking
Based on this issue https://github.com/aws-amplify/amplify-js/issues/563, where the suggestion is to run react-native link amazon-cognito-identity-js
. This however, with 0.60 provides the following error:
error Unknown dependency. Make sure that the package you are trying to link is already installed in your "node_modules" and present in your "package.json" dependencies.
Attempted Solution 2: Manually Linking
drag RNAWSCognito.xcodeproj, then link with library, but building then provides this error: node_modules/amazon-cognito-identity-js/ios/RNAWSCognito.h:4:9: 'React/RCTBridgeModule.h' file not found
Any help would be greatly appreciated!
To Reproduce
Steps to reproduce the behavior:
react-native init
, ensure you are on latest 0.60.0 versionamplify init
, thenamplify add auth
. Once configured, try signing up. Should work.- When trying to signIn, you should experience the errors above. Try automatically linking, then manually linking.
Expected behavior
Auth.signIn(username, password) should sign the user in.
Smartphone (please complete the following information):
- Device: iPhone X
- OS: iOS 12.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (2 by maintainers)
Top GitHub Comments
What worked for me is doing
hope this helps
@VicFrolov can you sign in if you do not have the react native debugger attached?
I get
Cannot read property 'USER_ID_FOR_SRP' of undefined
if the debugger is attached, but can successfully sign in when not attached.