Skip to content

Is the value of Auth.currentUser not displayed normally? #7348

@Sunjae95

Description

@Sunjae95

Operating System

MAC 13.3.1

Browser Version

chrome 114.0.5735.90

Firebase SDK Version

9.22.0

Firebase SDK Product:

Auth

Describe your project's tooling

I was testing auth.currentUser in a development environment with Next.js version 13.2.4.
auth.currentUser represents the currently signed-in user.
When I console.log auth, it shows auth.currentUser as null, but when I expand the auth object, currentUser is present.

What I want is for it to come out the same if auth.currentUser exists.

This inconsistency in auth.currentUser led me to raise an issue 😊

Describe the problem

/pages/app.js
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
console.log('auth', auth);
console.log('auth.currentUser', auth.currentUser);

// The image below shows the result of the code:

image

Steps and code to reproduce issue

1. I tested auth.currentUser to see if it was asynchronous using async await.

However, the same result was obtained.

2. I pressed save twice to check the results in development

For example, it means to re-insert and re-execute other code in a problem situation.

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions