Skip to main content
r/Firebase icon

r/Firebase

members
online

[Help] Cannot find module 'firebase/auth/react-native' in Expo/React Native (Firebase v12.7) [Help] Cannot find module 'firebase/auth/react-native' in Expo/React Native (Firebase v12.7)
Authentication

Hey everyone, I'm building my first app using Expo and Google Identity Platform (GCP). I'm trying to set up persistent authentication, but I've hit a wall with TypeScript errors.

The Goal: I want to use getReactNativePersistence so that my users stay logged in after they close the app.

The Problem: When I try to import from firebase/auth, the function getReactNativePersistence is missing from the type declarations.

My Code (firebaseConfig.ts):

TypeScript

import { initializeApp } from "firebase/app";
import { initializeAuth, getReactNativePersistence } from "firebase/auth";
import ReactNativeAsyncStorage from '@react-native-async-storage/async-storage';

// GCP Config is here...
const app = initializeApp(firebaseConfig);

const auth = initializeAuth(app, {
  persistence: getReactNativePersistence(ReactNativeAsyncStorage)
});

The Error: Module '"firebase/auth"' has no exported member 'getReactNativePersistence'.

What I've Tried:

  1. Changing the import to firebase/auth/react-native. Result: Cannot find module 'firebase/auth/react-native' or its corresponding type declarations.

  2. Adding a path mapping in tsconfig.json. Result: No change.

  3. I have already installed @react-native-async-storage/async-storage.

My Environment:

  • Expo SDK v54

  • Firebase v12.7

  • TypeScript

Does anyone know the "clean" way to fix this in 2025 without breaking the standard Firebase SDK structure? Is there a specifictsconfig change needed for Expo to recognize the /react-native export?


A streaming event for the eras is here. Stream The End of an Era, a six-episode behind-the-scenes docuseries chronicling the record-breaking tour and Taylor Swift | The Eras Tour | The Final Show, featuring THE TORTURED POETS DEPARTMENT for the first time.
A streaming event for the eras is here. Stream The End of an Era, a six-episode behind-the-scenes docuseries chronicling the record-breaking tour and Taylor Swift | The Eras Tour | The Final Show, featuring THE TORTURED POETS DEPARTMENT for the first time.




Morty Proxy This is a proxified and sanitized view of the page, visit original site.