Skip to content
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

Multiple apps - Single SDK #6378

Closed
ericmager opened this issue Jun 22, 2022 · 11 comments
Closed

Multiple apps - Single SDK #6378

ericmager opened this issue Jun 22, 2022 · 11 comments

Comments

@ericmager
Copy link

ericmager commented Jun 22, 2022

I'm using expo to implement the js sdk for a react native ios app. We already have the website up and running and everything works fine. I've tried using the same app sdk (api key, app name, etc) in as in the website, and I've also tried creating a new web app in firebase. I continue to get the same error when I try to log in or access authenticated data:

Possible Unhandled Promise Rejection (id: 30):
FirebaseError: Firebase: Error thrown when reading from storage. Original error: (0 , _idb.openDB) is not a function. (app/storage-get).
FirebaseError: Firebase: Error thrown when reading from storage. Original error: (0 , _idb.openDB) is not a function. (app/storage-get).
at readHeartbeatsFromIndexedDB$ (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:159841:33)
at tryCatch (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24626:19)
at Generator._invoke (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24606:26)
at Generator.next (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24657:23)
at tryCatch (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24626:19)
at invoke (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24664:22)
at http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:24688:13
at tryCallTwo (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:30339:7)
at doResolve (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:30503:15)
at new Promise (http://10.151.5.106:19000/index.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:30362:5)

`const firebaseConfig = {
apiKey: "xxxxxxxx",
authDomain: "bundle-find-staging.firebaseapp.com",
projectId: "bundle-find-staging",
storageBucket: "bundle-find-staging.appspot.com",
messagingSenderId: "524334210214",
appId: "xxxxxxxx",
};

const app = initializeApp(firebaseConfig);
const auth = getAuth(app);`

I've also tried with the persistence fix in #1847
`import { getReactNativePersistence } from "firebase/auth/react-native";

const firebaseConfig = {
...
};

let app: FirebaseApp;
let auth: Auth;
if (getApps().length < 1) {
app = initializeApp(firebaseConfig);
auth = initializeAuth(app, {
persistence: getReactNativePersistence(AsyncStorage),
});
} else {
auth = getAuth();
app = getApp();
}`

@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.

@gkhngyk
Copy link

gkhngyk commented Jun 24, 2022

The same issue, while debugging mode.

@ericmager
Copy link
Author

The same issue, while debugging mode.

Thank you! I hadn't even gotten that far to realize that was the root cause. It appears debugging messes up firebase auth.

@hevar
Copy link

hevar commented Jun 25, 2022

Similar/same issue here: Firebase: Error thrown when reading from storage. Original error: (0, _idb.openDB) is not a function. (app/storage-get).

Firebase: Error thrown when reading from storage. Original error: (0, _idb.openDB) is not a function. (app/storage-get).

I use React native debugger v. 0.12.1
Expo SDK v. 45
React devTools 4.24.7

@jbalidiong
Copy link
Contributor

Hi @ericmager, thanks for the report. I was able to reproduce the behavior now. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share.

@hsubox76
Copy link
Contributor

This may be an error with the Metro bundler. Can you take a look at the possible workarounds suggested in #6253 and let us know if they work?

@google-oss-bot
Copy link
Contributor

Hey @ericmager. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@ericmager if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@ShmuelPickRanky
Copy link

Still having this problem, Is there any solution for that?

@i-in-range
Copy link

I face this problem too. Only while debug mode. I can't to login into my app.

Possible Unhandled Promise Rejection (id: 2): FirebaseError: Firebase: Error thrown when reading from storage. Original error: (0 , _idb.openDB) is not a function. (app/storage-get).

@ShmuelPickRanky
Copy link

ShmuelPickRanky commented Jul 22, 2022 via email

@firebase firebase locked and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants