Skip to content
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

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRsaNative.RSA.generateKeys')] #145

Open
sharif2008 opened this issue Nov 14, 2022 · 8 comments

Comments

@sharif2008
Copy link

It does not work with expo-

Errors
[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRsaNative.RSA.generateKeys')]
at src\utils\pki.ts:11:4 in createKeyPairRSA
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:86:13 in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:66:31 in
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:86:13 in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:124:27 in invoke

@StrawberryChocolateFudge

I had the same error.
It works just fine after I ran npx expo run:android and ejected the native config. No other configuration was needed.

@willpiam
Copy link

Any way of doing this without ejecting?

@willpiam
Copy link

I had the same error. It works just fine after I ran npx expo run:android and ejected the native config. No other configuration was needed.

Could you share more about how to do this? Thank you!

@megothss
Copy link

megothss commented Sep 6, 2023

@StrawberryChocolateFudge thank you so much for the tip! It saved my day.

@willpiam you need to run npx expo prebuild and then run your app using npx expo run:android. Take a backup of the folder before, just in case.

@alessandrocapra
Copy link

alessandrocapra commented Sep 27, 2023

Is there a way of making it work without ejecting it? In modern Expo, let's say SDK 48/49?

I tried to debug what is actually imported:

import * as RSA from "react-native-rsa-native"

If I log the value of RSA, this is the output:

{"RNRSA": null, "RNRSAKeychain": null, "RSA": null, "RSAKeychain": null, "default": null}

If possible I would like to fix it and submit a PR, if someone can give some guidance

@RasVibe
Copy link

RasVibe commented Oct 6, 2023

Any updates regarding the null issue without ejecting in expo mentioned by @alessandrocapra ?

@alessandrocapra
Copy link

I ended up using node-forge instead, it works very well

@RasVibe
Copy link

RasVibe commented Oct 6, 2023

Alright - will look into it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants