Skip to content

Unable to resolve "./index.shared" from "./node_modules/@firebase/auth/dist/index.rn.d.ts" #8996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
J4ckyLIM opened this issue May 5, 2025 · 4 comments

Comments

@J4ckyLIM
Copy link

J4ckyLIM commented May 5, 2025

Operating System

macOS Sequoia 15.4.1

Environment (if applicable)

React native: 0.76.9

Firebase SDK Version

11.6.0

Firebase SDK Product(s)

Auth

Project Tooling

Expo: v52.0.0
React-native: v0.76.9

Detailed Problem Description

Hello here's the error i got when trying to load my app using expo, my initial goal is to implement MFA with TOTP for my react-native app (note: it works perfectly fine on the web app using React):

`Unable to resolve "./index.shared" from "node_modules/@firebase/auth/dist/index.rn.d.ts"``

This happens on both Simulator for iPhone and on Android.

Added this to my tsconfig to fix the error on my IDE (cursor) when importing getReactNativePersistence, which works

{
  "compilerOptions": {
    "paths": {
      "@firebase/auth": ["./node_modules/@firebase/auth/dist/index.rn.d.ts"]
    }
  },
  "extends": "expo/tsconfig.base"
}
Image

Steps and code to reproduce issue

import { initializeAuth, getReactNativePersistence } from '@firebase/auth';

const app = initFirebase();
initializeAuth(app, {
    persistence: getReactNativePersistence(AsyncStorage),
});
@J4ckyLIM J4ckyLIM added new A new issue that hasn't be categoirzed as question, bug or feature request question labels May 5, 2025
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev argzdev added api: auth and removed needs-triage question new A new issue that hasn't be categoirzed as question, bug or feature request labels May 5, 2025
@hsubox76
Copy link
Contributor

hsubox76 commented May 6, 2025

Does this problem only happen after adding the compilerOptions.paths fix?

What happens if you use the alternative fix - see here, where instead of modifying the tsconfig, you replace the typings line in node_modules/@firebase/auth/package.json #7584 (comment) - of course this would require using patch-package to make it permanent, or you would just leave it there while you're working in the IDE, but just want to see if it makes a difference.

@J4ckyLIM
Copy link
Author

J4ckyLIM commented May 7, 2025

Hello,

Thanks for your help first,

The problem occurs even without adding the compilerOptions.path fix, not having the fix shows a ts error. I just tried the alternative from your comment and the result is the same unfortunately, Unable to resolve "./index.shared" from "node_modules/@firebase/auth/dist/index.rn.d.ts" remains.
The main issue is that we are currently implementing MFA (with TOTP) to our Apps, works perfectly fine on the web side, but bumping firebase version to 11.6 on our react native app doesn't work at all, which means our authentication cannot work anymore and we do not have any alternative.

I've tried creating a new clean app with just expo 53 and firebase 11.6 and it worked perfectly fine, I need to find out if our current configuration can be the reason behind all this problem

@hsubox76
Copy link
Contributor

hsubox76 commented May 7, 2025

Thanks for trying the clean app. Let us know if you can isolate what setting in your current configuration causes this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants