# React Native Auth0 Possible Unhandled Promise Rejection

**URL:** <https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992>\
**Category:** Get Help\
**Tags:** clients, management-api\
**Created:** [November 23, 2022, 12:10pm UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992 "2022-11-23T12:10:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shally517](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shally517/32/33837_2.png) [@shally517](https://community.auth0.com/u/shally517)\
**Post date:** [November 23, 2022, 12:10pm UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/1 "2022-11-23T12:10:23Z")

</div>

In setting up samples, I’ve made some progress with the docs, but I’ve come into this error.

```auto
Possible Unhandled Promise Rejection (id: 1):
TypeError: undefined is not an object (evaluating '_yield$getCredentials.accessToken')

```

I haven’t worked much with react-native. I would love to get tips on the best ways to debug in it and hear of good resources that you can recommend to

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 24, 2022, 11:02am UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/2 "2022-11-24T11:02:53Z")

</div>

Hey there!

Can you share with us what quickstart / SDK / docs are you using so we can help you troubleshoot that? Links will be super helfpul!

---

<div class="post-metadata">

**Author:** ![veles1968](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/veles1968/32/33347_2.png) [@veles1968](https://community.auth0.com/u/veles1968)\
**Post date:** [December 3, 2022, 11:54am UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/3 "2022-12-03T11:54:02Z")

</div>

Hi,

I have the same issue.  
I am following this sample app:

> **[auth0-react-native-sample/00-Login-Expo at master ·...](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login-Expo)**
>
> master/00-Login-Expo

I get the error in the onLogin function, on the “getCredentials”-line:  
const onLogin = async () =\> {  
try {  
await authorize({scope: ‘openid profile email’});  
const {accessToken} = await getCredentials();  
Alert.alert('AccessToken: ’ + accessToken);  
} catch (e) {  
console.log(e);  
}  
};

Kind Regards,  
Dime

---

<div class="post-metadata">

**Author:** ![veles1968](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/veles1968/32/33347_2.png) [@veles1968](https://community.auth0.com/u/veles1968)\
**Post date:** [December 3, 2022, 6:03pm UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/4 "2022-12-03T18:03:17Z")

</div>

I found the solution by myself.

I didn’t pay attention on this warning from the tutorial:  
This SDK is not compatible with “Expo Go” app. It is compatible only with Custom Dev Client and EAS builds.

I am using indeed the Expo Go-App. So I switched to Custom Dev Client and EAS builds, and this was the solution. The step-by-step how to do this is here:

> **[Create development builds](https://docs.expo.dev/development/create-development-builds/)**
>
> Learn how to create development builds for a project.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 5, 2022, 8:29am UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/5 "2022-12-05T08:29:06Z")

</div>

Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 19, 2022, 8:29am UTC](https://community.auth0.com/t/react-native-auth0-possible-unhandled-promise-rejection/94992/6 "2022-12-19T08:29:16Z")

</div>

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