Skip to content

No Firebase App '[DEFAULT]' has been created #1588

@D4rkMindz

Description

@D4rkMindz

Reproduction

not possible since nuxt template is not working properly

Steps to reproduce the bug

  1. Create a composable "useRecord" that uses useCollection or useDocument
  2. use this composable in any setup function

Expected behavior

The function useDocument returns the document ref properly without displaying the error "No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app)."

Actual behavior

"No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app)." is displayed.

Additional information

I debugged a little (like many hours) and found out, that it would work as expected if:

  • the method "_useFirestoreRef" would call "docOrCollectionRef.firestore.app" instead of "useFirebaseApp()" for "getInitialValue()"
  • the method "addPendingPromise" would call "dataSource.firestore.app" instead of "useFirebaseApp()" for "const app = useFirebaseApp()"
    This adjustments were made in the dist folder in the file vuefire/dist/index.mjs

The retrieval of the default app (getApp()) does not seem to work if called from a composable. The selected app name does not seem to be used (if custom app names are used).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions