# TypeError: Cannot read property 'createConfig' of null during Okta initialization in React Native Typescript Android app

**URL:** <https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541>\
**Category:** OAuth/OIDC\
**Tags:** react-native\
**Created:** [October 29, 2025, 4:39pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541 "2025-10-29T16:39:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipak](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dipak](https://devforum.okta.com/u/dipak)\
**Post date:** [October 29, 2025, 4:39pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541/1 "2025-10-29T16:39:54Z")

</div>

Hello Okta Support,

I’m encountering a runtime error while integrating Okta into my React Native (Typescript) Android application. The error occurs during the initialization phase and prevents the app from proceeding with authentication.

**Error Message:**

Code

```auto
TypeError: Cannot read property 'createConfig' of null
    at createConfigWithCallbacks (index.bundle:194216:60)
    at createConfig (index.bundle:194246:25)
    at initOkta (index.bundle:193874:28)
    ...

```

**Environment Details:**

- Platform: Android

- Framework: React Native - Typescript

- package used: @okta/okta-react-native

**Steps Taken:**

- Followed Okta React Native SDK setup instructions

- Verified native module linking

- Confirmed that `createConfig` is being called with valid parameters

**Suspected Cause:** It appears that the native module may not be properly initialized or is returning `null`, causing `createConfig` to fail. This might be related to auto-linking or incorrect setup in `MainApplication.java`.

**Request:** Could you please help identify the root cause or suggest steps to resolve this issue? Any guidance on debugging native module initialization for Okta in React Native would be appreciated.

**Note :** we also tried **react-native-app-auth** package, it is also giving **authorize** is undefined.

Thank you!

---

<div class="post-metadata">

**Author:** ![jmussman](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/jmussman/32/2175_2.png) [@jmussman](https://devforum.okta.com/u/jmussman)\
**Post date:** [November 3, 2025, 11:52pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541/2 "2025-11-03T23:52:57Z")

</div>

Hi Dipak! _initOkta_ isn’t something that exists in the okta-react-native library, so the starting point of your stack trace has to be in your code somewhere which would imply something is missing 🙂

If you look at the README in the module source (or at [npmjs.com](http://npmjs.com)), it suggests import _createConfig_ directly from the module and using it. So any problems with the package and the import would fail at that point.

The other option is to import the module object and then reference _createConfig_ as a property of that, in which case you could be mistaken on the object reference and if it was null when you call the function you’ll get the error described. This is an example of what that technique would look like:

import { OktaAuth } from ‘@okta/okta-react-native’;  
import { oktaConfig } from ‘./config’;

OktaAuth.createConfig(oktaConfig);

I would really have to see your code in order to tell you where it is going wrong. Hopefully this explanation may trigger something for you.

---

<div class="post-metadata">

**Author:** ![dipak](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@dipak](https://devforum.okta.com/u/dipak)\
**Post date:** [November 13, 2025, 11:08am UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541/3 "2025-11-13T11:08:29Z")

</div>

> [@jmussman](#):
>
> _initOkta_

Hi @jmussman

Correct — `initOkta` is just a function we wrote in our code; it is not from Okta. Could we have a quick working session on this? Please let me know your availability so I can schedule it.

Thanks and best regards,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [December 13, 2025, 11:08am UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-null-during-okta-initialization-in-react-native-typescript-android-app/34541/4 "2025-12-13T11:08:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
