Open
Description
Operating System
n/a
Environment (if applicable)
Node.js
Firebase SDK Version
n/a
Firebase SDK Product(s)
app (https://firebase.google.com/docs/reference/js/app.firebaseserverapp)
Project Tooling
Server-rendered web app
Detailed Problem Description
Now that initializeApp
supports no-argument initialization (release note, implemented in #8483), it would be great if initializeServerApp
did the same. This would allow SSR web apps to use no-args init both on the server and the client.
Steps and code to reproduce issue
const serverApp = initializeServerApp();
Activity
jhuleatt commentedon Mar 25, 2025
A workaround is to pass an auto-initialized
FirebaseApp
instance toinitializeServerApp
:lucasoares commentedon May 5, 2025
I'm trying your workaround and I'm getting a stack overflow error:
I'm implementing the same cookie-based authentication strategy used in the friendlyeats-web Next.js sample. After a successful login, everything works fine, until I reload the page. On reload, the app crashes.
Previously, I was using initializeApp alone, and everything worked as expected... Any idea why?
justinmpier commentedon May 30, 2025
@lucasoares in nextjs you may want to send over only the necessary user info from the server to the client, vs the actual firebase user object.
chakrachi commentedon Jun 26, 2025
I'm having issues with this for final angular 20 deployment:
My firebaseserver app thinks it's in the browser