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?


Hands-on labs, threat isolation drills, and live ransomware demos — built for defenders. Zero Trust World • Orlando • March 4–6, 2026 Save $200 with code ZTWREDDIT26.
Hands-on labs, threat isolation drills, and live ransomware demos — built for defenders. Zero Trust World • Orlando • March 4–6, 2026 Save $200 with code ZTWREDDIT26.



Complete beginner, can someone help? We have a team of 5. Complete beginner, can someone help? We have a team of 5.
General

Hey everyone! We’re a team of five currently competing in a national hackathon (we somehow made it to the top 30!). We’re considering using Firebase for authentication and our database since it seems like the safest and most reliable option.

The problem is… we’re not very experienced with Firebase. We’re still struggling with the basics—fetching, updating, displaying, and deleting data from a webpage feels harder than it should, and we’d really appreciate some initial guidance to get on the right track.

Any help or pointers would mean a lot to us. Thanks! 🙏


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