-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withAuthenticator throwing randomBytes is not a function #224
Comments
Hi @Darkade aws-amplify-react-native 0.2.0 still referencing aws-sdk higher than 2.177.0. Could you clear node_modules then reinstall aws-amplify-react-native to make sure it is on 0.2.1 and see if problem still exists. |
Hey @richardzcode, thanks for your answer. The issue persists. I deleted This is my {
"name": "portatic",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"aws-amplify-react-native": "^0.2.1",
"react": "16.0.0",
"react-native": "0.51.0",
"react-native-elements": "^0.19.0",
"react-native-gifted-chat": "^0.3.0",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^1.0.0-beta.27"
},
"devDependencies": {
"babel-jest": "22.0.4",
"babel-preset-react-native": "4.0.0",
"jest": "22.0.4",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
}
|
@Darkade this occurs when you don't run
did you run this command? This is needed for the randombytes function if you are not using Expo 25+. Can you verify the version of the aws-sdk-js that is in your node_modules folder? |
Thanks. I did ran $ react-native link amazon-cognito-identity-js
Scanning folders for symlinks in /Users/ivan/git/portatic/client/node_modules (18ms)
rnpm-install info Android module amazon-cognito-identity-js is already linked
rnpm-install info iOS module amazon-cognito-identity-js is already linked We do have an Expo branch, I'm going to try it there Thanks guys |
@Darkade The issue fixed. Could you get the latest aws-amplify-react-native (0.2.2) and have a try? Thanks! |
Hey guys, I tried updating to Here's what I did. Am I missing something? $ rm -rf node_modules android ios
$ yarn install
$ react-native eject
$ react-native link amazon-cognito-identity-js
$ react-native run-android Also, here's my {
"name": "portatic",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"aws-amplify-react-native": "^0.2.2",
"react": "16.0.0",
"react-native": "0.52.2",
"react-native-elements": "^0.19.0",
"react-native-gifted-chat": "^0.3.0",
"react-native-vector-icons": "^4.5.0",
"react-navigation": "^1.0.0-beta.27"
},
"devDependencies": {
"babel-jest": "22.0.4",
"babel-preset-react-native": "4.0.0",
"jest": "22.0.4",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
} What's interesting to me, but maybe is not important. Is that neither the metro window, or the I really appreciate your support, guys |
@Darkade can you use npm instead of yarn? We did find that there was an issue that causing the error when using yarn. But npm had no problem. We fixed that issue and yarn works for us now. We'll look into more, but in the mean time maybe you could try npm? |
@richardzcode it worked! Thanks so much, Richard |
I'm getting this same error when logging in a user
|
@rayhaanq in react native you have to run
for that function. |
oh sorry, not using react native. Just the normal js library @mlabieniec |
@rayhaanq Ah ok thanks. It is the same requirement for both (currently). So if you are using js/rn right now, our libraries require a pinned version of the aws-sdk to |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
After updating amplify to
"aws-amplify-react-native": "^0.2.0"
I'm getting this error in my login screenundefined is not a function (Evaluating '_global.util.crypto.lib.randomBytes(128)')
I've searched and found that this might be a
amazon-cognito-identity-js
version issue amazon-archives/amazon-cognito-identity-js#646 but adding the line package.json doesn't solve the issue"aws-sdk": "2.177.0"
I'm trying with a this bare-bones app, but I'm getting the same Issue
I'm using
aws-amplify
to configure as suggested to me here #109 (comment)Any ideas what might be going on? Thanks!
The text was updated successfully, but these errors were encountered: