Skip to content

Next.js w/ Firebase Server-Side bug - simple fix #34077

@beebox

Description

@beebox

What example does this report relate to?

with-firebase

What version of Next.js are you using?

12.0.10

What version of Node.js are you using?

14.15.4

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

firebase

Describe the Bug

Data from firestore does not appear in the example page http://localhost:3000/profile/nextjs_user

Changing line 27 in pages/profile/[username].js fixed it for me. Thought this may be helpful to others

from:
const profile = await getProfileData(username)

to:
const { profile } = await getProfileData(username)

Expected Behavior

this data should be displayed on http://localhost:3000/profile/nextjs_user

<p>{profile.username}</p>
<p>{profile.message}</p>

To Reproduce

  1. Configure app as shown in the readme
  2. Run yarn dev
  3. Use button on page to create user
  4. go to http://localhost:3000/profile/nextjs_user

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.examplesIssue was opened via the examples template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions