I use Firebase on a lot of my projects, but I never used it with vue 3 before. For an Ionic Project, I am using Vue 3 with typescript. What I would do to initialize Firebase projects on Vue 2 is, on the main.js file, this:
new Vue({
router,
created() {
firebase.initializeApp(firebaseConfig)
}}).$mount('#app')
On vue 3 - main.ts -, tried:
const app = createApp(App, {
created(){
firebase.initializeApp(firebaseConfig)
}
})
But I get the message:
Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp()
It works if the initializeApp() is outside "app definition", in the root of the file. What could be the problem? Thanks