在更新我的项目后,我有firebaseui问题,这是我当前的代码:
import { AngularFireAuth } from '@angular/fire/compat/auth';
import firebase from 'firebase/compat/app';
import * as firebaseui from 'firebaseui';
import PhoneAuthProvider = firebase.auth.PhoneAuthProvider;
import GoogleAuthProvider = firebase.auth.GoogleAuthProvider;
export class SigninComponent implements OnInit, OnDestroy {
ui!: firebaseui.auth.AuthUI;
constructor(
private afAuth: AngularFireAuth,
private router: Router
) { }
ngOnInit(): void {
this.afAuth.app.then(app => {
const uiConfig: firebaseui.auth.Config = {
signInOptions: [
PhoneAuthProvider.PROVIDER_ID,
GoogleAuthProvider.PROVIDER_ID,
],
callbacks: {
signInSuccessWithAuthResult: this.onSuccessLogIn.bind(this)
}
}
this.ui = new firebaseui.auth.AuthUI(app.auth());
this.ui.start('#firebaseui-auth-container', uiConfig);
// this.ui.disableAutoSignIn();
})
}
我得到了这个错误:
./node_modules/firebaseui/dist/esm.js:347:22-60 - Error: export 'default' (imported as 'firebase') was not found in 'firebase/app' (possible exports: FirebaseError, SDK_VERSION, _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _registerComponent, _removeServiceInstance, deleteApp, getApp, getApps, initializeApp, onLog, registerVersion, setLogLevel)
我试着搜索并使用任何想法来找出问题,但没有工作…
有什么想法吗?!
FirebaseUI尚未针对Firebase身份验证SDK的v9进行更新。它积极参与在这个问题上,你可以跟踪进度。