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
- Support react-native-windows The current version of authenticator in amplify-js not working on react-native on macOS (https://github.com/Microsoft/react-native-windows), it fails with this issue: htt... — committed to mandrigin/amplify-js by mandrigin 4 years ago
- Support react-native-windows The current version of authenticator in amplify-js not working on react-native on macOS (https://github.com/Microsoft/react-native-windows), it fails with this issue: htt... — committed to mandrigin/amplify-js by mandrigin 4 years ago
- Amplify使って認証エンドポイントを叩く わかっていないこと ・トークンの行方 わかったこと Amplify-auth使うときの落とし穴 https://github.com/aws-amplify/amplify-js/issues/3682#issuecomment-654968318 — committed to taniyuu/CognitoMfaSample by taniyuu 4 years ago
This should be added to README documentation of
aws-amplify, especially for the React Native part. I followed the normal README guide to installaws-amplifybut also got this error before I googled it and went here. It should be emphasised that bothaws-amplifyandamazon-cognito-identity-jsshould 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