# TypeError: Cannot read property 'createConfig' of undefined

**URL:** <https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992>\
**Category:** Questions\
**Created:** [June 30, 2020, 9:59pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992 "2020-06-30T21:59:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![changjieyang](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@changjieyang](https://devforum.okta.com/u/changjieyang)\
**Post date:** [June 30, 2020, 9:59pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/1 "2020-06-30T21:59:23Z")

</div>

Platform: ReactNative app with Typescript.

Was able to integrate and run the app with Okta, the “” component renders the button, but  
keep getting TypeError after clicking on the “Login” button in the ReactNative app using the current okta versions:  
“@okta/okta-react-native”: “^1.4.1”,  
“@oktadev/schematics”: “^2.1.1”,

14:55  
[Unhandled promise rejection: TypeError: Cannot read property ‘createConfig’ of undefined]

Stack trace:  
node\_modules/@okta/okta-react-native/index.js:31:28 in createConfig  
node\_modules/regenerator-runtime/runtime.js:45:39 in tryCatch  
node\_modules/regenerator-runtime/runtime.js:274:21 in invoke  
node\_modules/regenerator-runtime/runtime.js:97:20 in prototype.method  
node\_modules/regenerator-runtime/runtime.js:45:39 in tryCatch  
node\_modules/regenerator-runtime/runtime.js:135:19 in invoke  
node\_modules/regenerator-runtime/runtime.js:170:10 in PromiseImpl$argument\_0  
node\_modules/promise/setimmediate/core.js:45:4 in tryCallTwo  
node\_modules/promise/setimmediate/core.js:200:12 in doResolve  
node\_modules/promise/setimmediate/core.js:66:2 in Promise  
…  
WARNING  
14:56  
[Unhandled promise rejection: TypeError: Cannot read property ‘signIn’ of undefined]

Stack trace:  
node\_modules/@okta/okta-react-native/index.js:88:22 in signIn  
node\_modules/regenerator-runtime/runtime.js:45:39 in tryCatch  
node\_modules/regenerator-runtime/runtime.js:274:21 in invoke  
node\_modules/regenerator-runtime/runtime.js:97:20 in prototype.method  
node\_modules/regenerator-runtime/runtime.js:45:39 in tryCatch  
node\_modules/regenerator-runtime/runtime.js:135:19 in invoke  
node\_modules/regenerator-runtime/runtime.js:170:10 in PromiseImpl$argument\_0  
node\_modules/promise/setimmediate/core.js:45:4 in tryCallTwo  
node\_modules/promise/setimmediate/core.js:200:12 in doResolve  
node\_modules/promise/setimmediate/core.js:66:2 in Promise

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [June 30, 2020, 10:24pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/2 "2020-06-30T22:24:50Z")

</div>

OktaDev Schematics only supports JavaScript at this time. You can see our [current templates](https://github.com/oktadeveloper/schematics/tree/main/src/add-auth/react-native). If you’d like to see TypeScript support added for React Native, please create an issue in the project.

Just to warn you: I’m going on vacation today and won’t be back until August. If you add the issue, I won’t be able to work on it until then.

---

<div class="post-metadata">

**Author:** ![changjieyang](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@changjieyang](https://devforum.okta.com/u/changjieyang)\
**Post date:** [June 30, 2020, 10:29pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/3 "2020-06-30T22:29:59Z")

</div>

Thanks for your quick response!

I’ve tried to manually integrate, is that a valid option for Typescript, or it won’t work both Schematics/Manual integration?  
The “Login” button was successfully rendered though, but when you click on it I guess TypeError thrown.  
Since it’s referring to your deployed code under node\_modules/, is there a work around?

‘@okta/okta-react-native’

// I also tried turning the “allowJs” to true in tsconfig file  
“compilerOptions”: {  
“allowJs”: true,

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [June 30, 2020, 10:57pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/4 "2020-06-30T22:57:04Z")

</div>

I haven’t tried to use TypeScript with React Native, so I’m not sure. I was able to integrate our React SDK with TypeScript so it should be possible. [Using Okta with React App in Typescript](https://devforum.okta.com/t/using-okta-with-react-app-in-typescript/7944)

---

<div class="post-metadata">

**Author:** ![changjieyang](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@changjieyang](https://devforum.okta.com/u/changjieyang)\
**Post date:** [July 6, 2020, 11:47pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/5 "2020-07-06T23:47:04Z")

</div>

Hi,

I tried the declaration module as suggested in the thread, but getting a different TypeError instead, as shown below. Is there okta-react-native with typescript example?

There’s an example which uses react-native-app-auth library, is this recommended for ReactNative app?

> **[oktadeveloper/okta-react-native-typescript-example](https://github.com/oktadeveloper/okta-react-native-typescript-example)**
>
> React Native Typescript Example. Contribute to oktadeveloper/okta-react-native-typescript-example development by creating an account on GitHub.

// in okta.d.ts file  
declare module ‘@okta/okta-react-native’

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/b/ba0c10fdd433f59b32bf0a6a5222b34103a1ce52.png)

[Unhandled promise rejection: TypeError: (0 , \_oktaD.signIn) is not a function]

Stack trace: [http://192.168.1.9:19001/node\_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:179987:35](http://192.168.1.9:19001/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:179987:35) in login$ node\_modules/regenerator-runtime/runtime.js:45:39 in tryCatch node\_modules/regenerator-runtime/runtime.js:274:21 in invoke […](http://localhost:19002/#)

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [August 4, 2020, 6:24pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/6 "2020-08-04T18:24:49Z")

</div>

> [@changjieyang](#):
>
> There’s an example which uses react-native-app-auth library, is this recommended for ReactNative app?

The most important thing IMO is to get something working. I’ve used the react-native-app-auth library before and created the example you mentioned. We use it in JHipster’s React Native support and I think it works well. Please try it and let us know if you have any issues.

---

<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:** [January 25, 2024, 6:19pm UTC](https://devforum.okta.com/t/typeerror-cannot-read-property-createconfig-of-undefined/9992/7 "2024-01-25T18:19:36Z")

</div>

Closed on January 25, 2024, 6:19pm UTC

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