vercel / next.js

The React Framework
https://nextjs.org
MIT License
122.81k stars 26.27k forks source link

Why firebase initialization is taking place on the server as it is supposed to run on client? #23768

Closed shreyas-jadhav closed 3 years ago

shreyas-jadhav commented 3 years ago

What version of Next.js are you using?

10.1

What version of Node.js are you using?

14.16.0

What browser are you using?

Chrome Dev

What operating system are you using?

Windows

How are you deploying your application?

not deploying

Describe the Bug

I have been folowing the examples with-firebase - https://github.com/vercel/next.js/tree/canary/examples/with-firebase with-firebase-cloud-messaging - https://github.com/vercel/next.js/tree/canary/examples/with-firebase-cloud-messaging

The examples don't provide how to add cloud messaging on an existing project with with-firebase . I'm extremely frustrated because there's no way i could run cloud messaging on my project. I'm constantly getting missing appId error. But when i debugged, i noticed two things when i run the with-firebase example:

Expected Behavior

  1. Initialization of client SDK on browser
  2. Fix error missing appId while using cloud messaging

To Reproduce

Official example with-firebase and add the functionality for FCM.

shreyas-jadhav commented 3 years ago

I found out the issue was because not passing the same client object on the next-firebase-auth SDK

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.