You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My knowledge of Vue and Nuxt plugins is somewhat limited, but it seems to me that there is a bug with regards to the initialisation of the FirebaseApp server side (at least in middlewares). Yes, the features related to Firebase Auth shown in the documentation work (e.g. getCurrentUser), but not using Firestore.
Example, simply getting the Firestore instance in a middleware (SSR enabled):
And yes, my Firebase app returned here is still [DEFAULT].
Expected behavior
I would expect the Firestore utility functions and composables to work out of the box, i.e. the FirebaseApp to be initialized, in the context of server-side middlewares.
Actual behavior
FirebaseApp isn't initialized
Additional information
No response
The text was updated successfully, but these errors were encountered:
aaaaahaaaaa
changed the title
Nuxt plugin doesn't initialize Firebase app in server-side middleware
Nuxt plugin doesn't initialize FirebaseApp in server-side middleware
Sep 17, 2024
aaaaahaaaaa
changed the title
Nuxt plugin doesn't initialize FirebaseApp in server-side middleware
Nuxt plugin doesn't properly initialize FirebaseApp in server-side middleware
Sep 17, 2024
Reproduction
https://github.com/aaaaahaaaaa/vuefire-bug-170924
Steps to reproduce the bug
My knowledge of Vue and Nuxt plugins is somewhat limited, but it seems to me that there is a bug with regards to the initialisation of the
FirebaseApp
server side (at least in middlewares). Yes, the features related to Firebase Auth shown in the documentation work (e.g.getCurrentUser
), but not using Firestore.Example, simply getting the Firestore instance in a middleware (SSR enabled):
Throws the typical error:
It's reproduced on the test repo here. Only the config and the service account need to be added.
When accessing directly the
firebaseApp
provided by the plugin itself as a helper here, it does work:And yes, my Firebase app returned here is still
[DEFAULT]
.Expected behavior
I would expect the Firestore utility functions and composables to work out of the box, i.e. the FirebaseApp to be initialized, in the context of server-side middlewares.
Actual behavior
FirebaseApp isn't initialized
Additional information
No response
The text was updated successfully, but these errors were encountered: