question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

With React Native 0.60.0, Auth.signIn returns error, but signUp, and confirmSignUp works

See original GitHub issue

Describe 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:

  1. react-native init, ensure you are on latest 0.60.0 version
  2. amplify init, then amplify add auth. Once configured, try signing up. Should work.
  3. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
Raythodecommented, Jul 27, 2019

What worked for me is doing

  1. yarn add amazon-cognito-identity-js or npm install amazon-cognito-identity-js
  2. cd ios
  3. pod install --repo-update

hope this helps

6reactions
owinter86commented, Jul 24, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why amplify is giving me this error despite it does doing the ...
AWS Amplify Auth: How to disable AmplifyConfirmSignUp? 1 · Looking for advice on how to correctly setup the auth flow using React, Amplify,...
Read more >
Authentication - Sign up, Sign in & Sign out - React Native
When signing in with user name and password, you will pass in the username and the password to the signIn method of the...
Read more >
DataStore - CRUD (Create Read Update Delete)
When the device returns online, the application must reconnect to the backend, synchronize the data and resolve conflicts, if any.
Read more >
Authentication in React with AWS Cognito and Amplify
With a user pool, your users can sign in to your web or mobile app through Amazon Cognito. Your users can also sign...
Read more >
React Native Login Authentication PART 1 (step-by-step tutorial)
... learn how to implement login authentication flow in React Native : Sign In, Confirm Sign Up, Reset Password, Custom Inputs, Custom but......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found