Skip to content

[FIXED] :: TypeError: _base__WEBPACK_IMPORTED_MODULE_1__.default.auth is not a function #36

@irfan-zahir

Description

@irfan-zahir

Describe the bug
image

In Auth.js, import firebase/auth.
import { onAuthStateChanged, getAuth } from 'firebase/auth'

define const auth. pass app imported from base.js into getAuth()
const auth = getAuth(app)

Next, in the useEffect, remove app.auth(). pass auth as first parameter in onAuthStateChanged.
onAuthStateChanged(auth, (user) => { setCurrentUser(user) setPending(false) });

!!REFERENCE!!
https://firebase.google.com/docs/auth/web/start
https://firebase.google.com/docs/auth/web/phone-auth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions