[Vuejs]-$ Uncaught (in promise) TypeError: Cannot read properties of null (reading 'uid') at setup – Quasar 2, Firebase 9 Authentication, Vue.js 3, JavaScript

0👍

OMHeck! 😳 I found the answer thanks to Sy3d

How to mount quasar app to dom after firebase connection is initialized?

src/boot/auth.js

import { auth } from 'src/boot/firebase'

export default async ({ app, router, store }) => {
    return new Promise(resolve => {
        const unsubscribe = authService.onAuthStateChanged(() => {
            resolve()
            unsubscribe()
        })
    })
}

Leave a comment