Recently, I decided to integrate Firebase libraries into my Vue project by installing them using npm install firebase
.
I then proceeded to add these Firebase libraries in my main.js
file:
import { Firebase } from 'firebase/app'
import 'firebase/analytics'
import 'firebase/auth'
import 'firebase/messaging'
Firebase.initializeApp({
apiKey: 'xxx',
authDomain: 'xxx',
databaseURL: 'xxx',
projectId: 'xxx',
storageBucket: 'xxx',
messagingSenderId: 'xxx',
appId: 'xxx',
measurementId: 'xxx'
})
However, upon doing this setup, I encountered the following error:
Uncaught TypeError: Cannot read property 'initializeApp' of undefined