-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Firebase UI is incompatible with Firebase SDK 9 (beta) #837
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
Comments
Hey @johanrd, this is a known limitation (documented in official docs too). v9 is still in beta. We will update the README to also reflect this issue. |
Documentation says:
Can you please explain how to do it, if at all possible? |
Source: https://firebase.google.com/docs/auth/web/firebaseui Has anyone solved this? I've tried importing both files mentioned above but it still doesn't work. I can't find documentation about this. |
If I run,
I get an npm error,
Full error: eresolve-report.txt Did anyone else trying to use Firebase UI with Firebase SDK 9 have this issue? |
I had to add |
Working on support over at #850 FYI. |
This is available for testing now, |
Great. I can verify that [email protected] *works* with the following versions: "firebase": "^9.0.0-202171919375",
"firebaseui": "^0.600.0-rc.0", …However: As I understand it, the expected bundle size reduction from the modularized import API of firebase@9 is still a distant dream as long as [email protected] imports the whole shebang from 1) Make firebaseui utilize the modularized import API of firebase@9, e.g. something like: -import firebase from 'firebase/compat/app';
-import 'firebase/compat/auth';
+ import { AuthCredential, GoogleAuthProvider, PhoneAuthProvider, EmailAuthProvider, GithubAuthProvider, SAMLAuthProvider, OAuthProvider, RecaptchaVerifier, Auth } from 'firebase/compat/auth'; 2) Make the API of firebaseui-web itself modularized (as opposed to -export { auth };
+ export { auth, FirebaseUiHandler, selectTenant, getAuth, startSignIn, reset, showProgressBar, hideProgressBar, completeSignOut, handleError, processUser, AuthUI, getInstance, disableAutoSignIn, start, setConfig, signIn, reset, delete, isPendingRedirect, AuthUIError, toJSON, ACCOUNT_CHOOSER_COM, GOOGLE_YOLO, NONE, PROVIDER_ID}; …or have I misunderstood what is possible/viable here? |
Any more updates or progress on getting Firebase UI compatible with Firebase SDK 9? |
@johanrd the way the Firebase UI library is written currently is not compatible with the modular structure of v9, so it's unlikely Firebase UI will benefit from the tree shaking features anytime soon. It's something we're definitely looking into but for the time being I can't say when or if we'll have an update there. @kcb-reninja the library should be compatible with v9 (compat). If you're seeing issues, please file a separate bug report. Thanks all! |
Hi if possible could someone update me on the situation as I am currently trying to use the firebase auth UI and have had no luck for a couple of weeks while integrating it into react. The firebase version I am using is 9.22.0, is this version okay to use along side the firebase auth drop in ui solution, any feedback will be geat, thanks |
I have the same issue. I'm using a React JS app. It would be really helpful if the Firebase team could fix it(including it in the v9 SDK and not only the v9 compact SDK). |
Can't use the compat library. I miss out on the cool features. |
Hi @shauryaaher, for now FirebaseUI-web only works with v9 via the compatibility layer. We know this is a pain point, and we're investigating updates to allow it to work with the modular syntax, but at this time I can't share any timelines. |
Ok. Let's hope it comes around soon. I would be really good if it comes around a week after Google IO. I'm terrible at CSS styling, and I don't have a very big team to handle that work for me. |
Could someone please post an example on how to get Firebaseauth UI to work with v9 with the compatibility layer? I'm getting stuck with this error and I suspect it's because I'm not importing the libraries correctly:
|
This is what worked for me. I am using webpack with a css loader so I can import css as shown below. import { getAuth } from 'firebase/auth';
import firebase from 'firebase/compat/app';
import * as firebaseui from 'firebaseui';
import 'firebaseui/dist/firebaseui.css';
const auth = getAuth();
const ui = new firebaseui.auth.AuthUI(auth);
const uiConfig = {
signInSuccessUrl: './',
signInOptions: [
// Leave the lines as is for the providers you want to offer your users.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID,
// firebase.auth.FacebookAuthProvider.PROVIDER_ID,
// firebase.auth.TwitterAuthProvider.PROVIDER_ID,
// firebase.auth.GithubAuthProvider.PROVIDER_ID,
// firebase.auth.PhoneAuthProvider.PROVIDER_ID,
],
// Terms of service url.
tosUrl: './#tos',
// Privacy policy url.
privacyPolicyUrl: './#privacy',
};
// The start method will wait until the DOM is loaded.
ui.start('#firebaseuiAuthContainer', uiConfig); Then I added an empty div with id='firebaseuiAuthContainer' to my html where I wanted the sign in UI to show up. It's kind of weird because you have to use a hybrid v8/v9 way of getting auth and the UI. I finally found the above after digging for a long time in the firebase documentation, but I can't find the link, or I would attach it. I agree that a clean v9 version of this feature is needed. Hope this helps! |
Having a tree-shaking JS is very important to reduce bandwidth and JS sizes which is better for the environement too (less impact on client memory, faster parsing time, etc etc). After almost 2y after v9 release, I would have think this library was updated already but it is not :/ |
😢 Almost 2 years... |
On one hand, there are now some new Firebase features, e.g. AppCheck support only V9. On the other hand, this FirebaseUI can only use compat sdk. Can someone from Angular (@sam-gc?) or Firebase (@jamesdaniels?) team comment on if/when will this be fixed? This would at least give the community a better idea if we should switch to something else. Thanks! |
Firebase SDK 9 is now released in beta. When testing with Firebase UI 4.8.0, it becomes clear that Firebase UI is not ready to be used with the modularized import api of Firebase SDK 9.
Steps to reproduce:
firebase
is undefined in firebaseui-web:firebaseui-web/javascript/widgets/authui.js
Line 127 in 1a8f9e5
TypeError: Cannot read property 'initializeApp' of undefined
@davideast has commented on the issue over at firebase/firebase-js-sdk#4375 (comment) in February:
We don't have a version of Firebase UI available for the new SDK just yet. But hang tight!
I could not see the issue being tracked here, so therefore I'm posting it as a specific reproducible bug to track. (The theme is somewhat already addressed in #257, however there as a more general issue).
The text was updated successfully, but these errors were encountered: