# TypeError: can't access property "hasValidAuth0Instance", nativeModule is undefined

**URL:** <https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [March 2, 2024, 4:42pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776 "2024-03-02T16:42:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![serafdev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/serafdev/32/55339_2.png) [@serafdev](https://community.auth0.com/u/serafdev)\
**Post date:** [March 2, 2024, 4:42pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/1 "2024-03-02T16:42:56Z")

</div>

I’m trying to setup Authentication going through this tutorial: [Auth0 Expo SDK Quickstarts: Login](https://auth0.com/docs/quickstart/native/react-native-expo/00-login)

The Login is working when running `expo run:android`

The Android App runs, and redirects properly to the Login Page, afterwards I log in using my auth0 account and it redirects me back properly to Android, I can see the Token and read the information in it (Email, etc). All good on this side

However the Web version runs (`expo start --web`) but is stuck on Loading…, in the Console in my browser I find this:

```auto
Uncaught (in promise) TypeError: can't access property "hasValidAuth0Instance", nativeModule is undefined
    _ensureNativeModuleIsInitialized2 nativeHelper.js:5
    Babel 4
        asyncGeneratorStep
        _next
        _asyncToGenerator
        _asyncToGenerator
nativeHelper.js:5:10
    Babel 6
        asyncGeneratorStep
        _throw
        (Async: promise callback)
    asyncGeneratorStep
        _next
        _asyncToGenerator
        _asyncToGenerator
    Auth0Provider auth0-provider.js:78
    React 11
    (Async: EventHandlerNonNull)
    <anonymous> AppEntry.bundle:11666
    <anonymous> React
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> React
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    React 2
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> React
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> index.js:2
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> index.js:14
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> registerRootComponent.js:3
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> AppEntry.js:5
    loadModuleImplementation require.js:283
    guardedLoadModule require.js:182
    metroRequire require.js:91
    <anonymous> AppEntry.bundle:67210

```

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![stuttskl](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stuttskl/32/59893_2.png) [@stuttskl](https://community.auth0.com/u/stuttskl)\
**Post date:** [June 3, 2024, 5:57pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/2 "2024-06-03T17:57:54Z")

</div>

Did you find a solution to this? I am facing the same thing @serafdev

---

<div class="post-metadata">

**Author:** ![andreim.damian](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/andreim.damian/32/57676_2.png) [@andreim.damian](https://community.auth0.com/u/andreim.damian)\
**Post date:** [June 6, 2024, 8:13am UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/3 "2024-06-06T08:13:09Z")

</div>

same here, anybody able to fix this?

---

<div class="post-metadata">

**Author:** ![jirwincline](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jirwincline/32/58061_2.png) [@jirwincline](https://community.auth0.com/u/jirwincline)\
**Post date:** [June 25, 2024, 7:55am UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/4 "2024-06-25T07:55:09Z")

</div>

Any updates on this? I’m getting it with Expo, react-native-web, and expo-router

The docs don’t really account for expo router so I was wondering if that is part of the issue

---

<div class="post-metadata">

**Author:** ![jirwincline](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jirwincline/32/58061_2.png) [@jirwincline](https://community.auth0.com/u/jirwincline)\
**Post date:** [June 25, 2024, 5:56pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/5 "2024-06-25T17:56:40Z")

</div>

What did you end up doing?

---

<div class="post-metadata">

**Author:** ![stuttskl](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stuttskl/32/59893_2.png) [@stuttskl](https://community.auth0.com/u/stuttskl)\
**Post date:** [July 3, 2024, 9:34pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/6 "2024-07-03T21:34:07Z")

</div>

I had to change the ios target deployment version to 13.0 in my podfile, then auth0 worked

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [January 31, 2025, 8:01pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/7 "2025-01-31T20:01:55Z")

</div>

Hi @serafdev

Welcome to the Auth0 Community!

I am sorry about the late reply to your inquiry.

As far as I have checked, the `hasValidAuth0Instance` error that you are receiving seems to be specific when you are using **Expo Go** with your React Native Application.

As mentioned on our [SDK page](https://auth0.com/docs/quickstart/native/react-native-expo/interactive):

> This SDK is not compatible with “Expo Go” app. It is compatible only with Custom Dev Client and EAS builds.

Alternatively, you might be missing the audience parameter in the `authorize()` call. You would have to pass the audience parameter when you make the call as follows:

```auto
const onLogin = async () => {
    try {
      await authorize({ audience: 'https://test.api'});
      let credentials = await getCredentials();
      Alert.alert('AccessToken: ' + credentials.accessToken);
    } catch (e) {
      console.log(e);
    }
  };

```

This code is referenced here: [react-native-auth0/src/hooks/ **tests** /use-auth0.spec.jsx at e1771491969934cc20dd3ed0e8beeb6c5cf70577 · auth0/react-native-auth0 · GitHub](https://github.com/auth0/react-native-auth0/blob/e1771491969934cc20dd3ed0e8beeb6c5cf70577/src/hooks/ __tests__ /use-auth0.spec.jsx#L223)

Also, you might be missing some kind of configuration specific from our [React Native SDK](https://github.com/auth0/react-native-auth0#configure-the-sdk).  
If you run `npx create-react-native-app`, you may have to configure native code differently than if you had built using the `npx create-expo-app` . The two scripts produce slightly different **gradle** files from what I can tell.

My personal advise would be to switch to Custom Dev Client and EAS builds, even if it is inconvenient

If you have any other questions on the matter or found a solution to it already, feel free to let us know by leaving a reply!

Kind Regards,  
Nik

---

<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:** [February 14, 2025, 8:02pm UTC](https://community.auth0.com/t/typeerror-cant-access-property-hasvalidauth0instance-nativemodule-is-undefined/128776/9 "2025-02-14T20:02:59Z")

</div>

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