amplify-js: null is not an object (evaluating RNAWSCognito.computeModPow)

Describe the bug I hope this saves someone some time (and frustration)

A user can sign up or view the login page, but upon login, the following error is observed:

null is not an object (evaluating RNAWSCognito.computeModPow)

To Reproduce Create new >=RN0.60.0 project cd ios pod install build

Expected behavior Amplify podspec should correctly list RNAWSCognito.

Smartphone (please complete the following information):

  • All

Additional context remember not to use react-native link when working in >=0.60.0

Fix simply run the following in your project root

yarn add amazon-cognito-identity-js
cd ios
pod install

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 21
  • Comments: 38 (9 by maintainers)

Commits related to this issue

Most upvoted comments

This should be added to README documentation of aws-amplify, especially for the React Native part. I followed the normal README guide to install aws-amplify but also got this error before I googled it and went here. It should be emphasised that both aws-amplify and amazon-cognito-identity-js should be installed for React Native (at least for now as a workaround).

I’ve just spotted that you mentioned it’s not in your pod file - that’s explains it. I had to manually add it:

#pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'

Thanks @BradyShober I’ve tried deleting the DerivedData contents and I’m still getting the same error. To be clear, I can build the Xcode project without any issues and run/debug it through Xcode.

I’m only seeing the compilation error when I try to run react-native run-ios from Terminal.

@BradyShober - nice, I’ll add that to my ever growing list of tricks and fixes

@kirkryan I ended up making a call out of this on our docs about this and the workaround. Please see the above PR that was merged. Closing issue as the workaround resolves this issue