magic-js
magic-js copied to clipboard
Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
- [x] Are you running the latest SDK version?
- [x] Are you reporting to the correct repository (
magic-sdk
)?
🐛 Description
Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
To fix this issue try these steps:
• Rebuild and restart the app.
• Run the packager with --reset-cache
flag.
• If you are using CocoaPods on iOS, run pod install
in the ios
directory and then rebuild and re-run the app.
• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest
If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-async-storage/async-storage/issues , js engine: hermes
🧩 Steps to I follow to install package in React Native
- npm install --save @magic-sdk/react-native
- npm install --save react-native-webview
💻 Code Sample
const { Magic } = require('@magic-sdk/react-native');
const m = new Magic('API_KEY'); // ✨
const onSubmit = async () => {
await m.auth.loginWithEmailOTP({ email: '[email protected]' }).then((res) => { console.log(res); })
}
🌎 Environment
Software | Version(s) |
---|---|
Operating System | Android |
Hello @kb-codes Thank you for submitting this issue. Would you please share which Magic SDK and version you are using? Also, have you already tried the steps included to resolve the issue? Was this app created with Expo CLI?
Hello, Thanks for the quick replay I'm using magic-sdk/react-native and the version is 10.0.1 for React Native.
And this app was created with React Native CLI
Please solve this ASAP, I was stuck at work because of this.
@kb-codes Could you give us the steps to reproduce the error?
Here you go,
- Create a project with this command - npx react-native init AwesomeProject
- npm install --save @magic-sdk/react-native
- npm install --save react-native-webview
- npx react-native run-android
- In App.js file:
const { Magic } = require('@magic-sdk/react-native');
const m = new Magic('API_KEY'); // ✨
const onSubmit = async () => {
await m.auth.loginWithEmailOTP({ email: '[email protected]' }).then((res) => { console.log(res); })
}
const App ()=>{
return(
<TouchableOpacity onPress={onSubmit}><Text>Login</Text></TouchableOpacity>
)
}
Hello, @am-hernandez, Any updates ?
Hello, @am-hernandez, Please update me with a solution, I'm waiting for the production.
Hi @kb-codes sorry for the delay in response. I wasn't able to replicate this issue so I asked for some more eyes on this from our Mobile team. Please give us more time to look into this and follow up here. Thank you!
@kb-codes have you ever managed to fix this ? having the exact same issue.
@agonist @kb-codes
We have since updated our SDKs and this may no longer be an issue with later versions. If you are able to reproduce the issue with these new SDKs please let us know.
Here are the new SDKs for Magic React Native:
-
@magic-sdk/react-native-bare
-
@magic-sdk/react-native-expo
Please let us know if you are able to reproduce this issue with either of the two SDKs listed above. Thank you!