Skip to content

Expo54 : "react-native-auth0" does not contain a valid config plugin #1387

Description

@aepiard101010

Checklist

Description

Hello,

I tried to use react-native-auth0 within an expo project, for a web app and an android phone. I'm on Expo54 and React19. After installing react-native-auth0 and nothing else on my new project, i added the config plugin line in app.json, and i have this warning on the package line. I'm on VSCode with React Native Tools and Expo Tools.

Package "react-native-auth0" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'(INVALID_PLUGIN_IMPORT)

Thinking i could still try to use the package, i tried to do on my first _layout.tsx :

import { Auth0Provider } from "react-native-auth0";

No error there, so i'm trying to do a prebuild and start. No error here either. I build the project on web, works fine. I build the project on android, i get this error :

[Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'A0Auth0' could not be found. Verify that a module by this name is registered in the native binary.]
Call Stack
  invariant (node_modules\invariant\browser.js)
  getEnforcing (node_modules\react-native\Libraries\TurboModule\TurboModuleRegistry.js)
  <global> (node_modules\react-native-auth0\src\specs\NativeA0Auth0.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\platforms\native\bridge\NativeBridgeManager.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\platforms\native\bridge\index.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\platforms\native\adapters\NativeAuth0Client.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\platforms\native\index.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\factory\Auth0ClientFactory.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\Auth0.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\hooks\Auth0Provider.tsx)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (node_modules\react-native-auth0\src\index.ts)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  <global> (app\_layout.tsx)
  loadModuleImplementation (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  guardedLoadModule (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  metroRequire (node_modules\expo\node_modules\@expo\cli\build\metro-require\require.js)
  Object.defineProperties$argument_1._layoutTsx.get (app)
  metroContext (app)
  node.loadRoute (node_modules\expo-router\build\getRoutesCore.js)
  getDirectoryTree (node_modules\expo-router\build\getRoutesCore.js)
  getDirectoryTree (node_modules\expo-router\build\getRoutesCore.js)
  getRoutes (node_modules\expo-router\build\getRoutesCore.js)
  getRoutes (node_modules\expo-router\build\getRoutes.js)
  useStore (node_modules\expo-router\build\global-state\router-store.js)
  ContextNavigator (node_modules\expo-router\build\ExpoRoot.js)
  callComponent.reactStackBottomFrame (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  renderWithHooks (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  updateFunctionComponent (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  beginWork (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  runWithFiberInDEV (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  performUnitOfWork (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  workLoopSync (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  renderRootSync (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  performWorkOnRoot (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  performWorkOnRootViaSchedulerTask (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)

Call Stack
  ExpoRoot (node_modules\expo-router\build\ExpoRoot.js)
  App (node_modules\expo-router\build\qualified-entry.js)
  WithDevTools (node_modules\expo\src\launch\withDevTools.tsx)

I searched for solutions and issues related but found no solution. Some people were talking about turning newArchEnabled to false, but i will need it to true later on.

I would like to know what config i'm missing to make this work on my android phone.

Reproduction

  1. npx create-expo-app@latest expoauth0
  2. cd expoauth0
  3. npm install react-native-auth0
  4. app.json
"plugins": [
      "expo-router",
      [
        "expo-splash-screen",
        {
          "image": "./assets/images/splash-icon.png",
          "imageWidth": 200,
          "resizeMode": "contain",
          "backgroundColor": "#ffffff",
          "dark": {
            "backgroundColor": "#000000"
          }
        }
      ],
      [
        "react-native-auth0",
        {
          "domain": "my-domain.eu.auth0.com"
        }
      ]
    ]
  1. app/_layout.tsx
import { Auth0Provider } from "react-native-auth0";
  1. npx expo prebuild --clean
  2. npx expo start --clear
  3. Press a to build on android
  4. [Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'A0Auth0' could not be found. Verify that a module by this name is registered in the native binary.]

Additional context

npx expo -v
54.0.16

package.json :

{
  "name": "expoauth0",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "reset-project": "node ./scripts/reset-project.js",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "lint": "expo lint"
  },
  "dependencies": {
    "@expo/vector-icons": "^15.0.3",
    "@react-navigation/bottom-tabs": "^7.4.0",
    "@react-navigation/elements": "^2.6.3",
    "@react-navigation/native": "^7.1.8",
    "expo": "~54.0.25",
    "expo-constants": "~18.0.10",
    "expo-font": "~14.0.9",
    "expo-haptics": "~15.0.7",
    "expo-image": "~3.0.10",
    "expo-linking": "~8.0.9",
    "expo-router": "~6.0.15",
    "expo-splash-screen": "~31.0.11",
    "expo-status-bar": "~3.0.8",
    "expo-symbols": "~1.0.7",
    "expo-system-ui": "~6.0.8",
    "expo-web-browser": "~15.0.9",
    "react": "19.1.0",
    "react-dom": "19.1.0",
    "react-native": "0.81.5",
    "react-native-auth0": "^5.1.0",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-reanimated": "~4.1.1",
    "react-native-safe-area-context": "~5.6.0",
    "react-native-screens": "~4.16.0",
    "react-native-web": "~0.21.0",
    "react-native-worklets": "0.5.1"
  },
  "devDependencies": {
    "@types/react": "~19.1.0",
    "eslint": "^9.25.0",
    "eslint-config-expo": "~10.0.0",
    "typescript": "~5.9.2"
  },
  "private": true
}

app.json :

{
  "expo": {
    "name": "expoauth0",
    "slug": "expoauth0",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "expoauth0",
    "userInterfaceStyle": "automatic",
    "newArchEnabled": true,
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "backgroundColor": "#E6F4FE",
        "foregroundImage": "./assets/images/android-icon-foreground.png",
        "backgroundImage": "./assets/images/android-icon-background.png",
        "monochromeImage": "./assets/images/android-icon-monochrome.png"
      },
      "edgeToEdgeEnabled": true,
      "predictiveBackGestureEnabled": false,
      "package": "com.anonymous.expoauth0"
    },
    "web": {
      "output": "static",
      "favicon": "./assets/images/favicon.png"
    },
    "plugins": [
      "expo-router",
      [
        "expo-splash-screen",
        {
          "image": "./assets/images/splash-icon.png",
          "imageWidth": 200,
          "resizeMode": "contain",
          "backgroundColor": "#ffffff",
          "dark": {
            "backgroundColor": "#000000"
          }
        }
      ],
      [
        "react-native-auth0",
        {
          "domain": "my-domain.eu.auth0.com"
        }
      ]
    ],
    "experiments": {
      "typedRoutes": true,
      "reactCompiler": true
    }
  }
}

AndroidManifest.xml :

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
  <uses-permission android:name="android.permission.VIBRATE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <queries>
    <intent>
      <action android:name="android.intent.action.VIEW"/>
      <category android:name="android.intent.category.BROWSABLE"/>
      <data android:scheme="https"/>
    </intent>
  </queries>
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:enableOnBackInvokedCallback="false">
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="expoauth0"/>
      </intent-filter>
    </activity>
    <activity android:name="com.auth0.android.provider.RedirectActivity" tools:node="replace" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="com.anonymous.expoauth0.auth0" android:pathPrefix="/android/com.anonymous.expoauth0/callback" android:host="my-domain.eu.auth0.com"/>
      </intent-filter>
    </activity>
  </application>
</manifest>

react-native-auth0 version

5.1.0

React Native version

0.81.5

Expo version

54.0.25

Platform

Android

Platform version(s)

Android 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions