descope/descope-react-native

AuthProvider error on loadItem

Closed this issue · 4 comments

I have a simple react native project on which I wanted to integrate descope onboarding flows. However simply wrapping the App in <AuthProvider /> gives the following error.

 ERROR  TypeError: Cannot read property 'loadItem' of null

This error is located at:
    in AuthProvider (created by App)
    in RCTSafeAreaView (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in EventsMeet(RootComponent), js engine: hermes

Heres the screenshot from the app:
Simulator Screenshot - iPhone 15 - 2024-02-14 at 21 43 28

I am using
React Native: 0.72.6 on iOS 17.2 emulator

Any Updates?

@Karrthik-Arya Thanks for reporting, can please provide a step-by-step guide to recreate that error? How the project was created, exact sequence for initialization commands, code used, etc.

I had the same issue on a blank, brand-new react native project using react-native@latest init <name> followed only by the install instructions from this project's readme . (regarding repro @itaihanski)

After some digging, I found out that it's missing the native (iOS/Android) module to import. In my case, it was solved for iOS by navigating to /ios and running pod install there, which built the descope-react-native artefact.

Thanks @iStefo, I'll make sure to clarify this point in the README.