I get the following error.
Cannot read property ‘GoogleAuthProvider’ of undefined
The code is
import firebase from 'firebase/app'
import 'firebase/auth'
var firebaseConfig = {...}
firebase.initializeApp(firebaseConfig)
const provider = new firebase.auth.GoogleAuthProvider()
firebase.auth().useDeviceLanguage()
if (this.device === 'Mobile') {
firebase.auth().signInWithRedirect(provider)
.then((result) => {
.........................
})
}
After checking, it seems that ‘firebase/auth’ is not being imported.
Is there a solution?