Unable to import firebase in the velo code.

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?

1 Like

I have a similar problem. I cannot successfully call
firebase . initializeApp ( firebaseConfig )

without getting the error

Er ror: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.