Skip to content

Unable to provide getDatabase(): Error: AngularFireModule has not been provided at getSchedulers #2999

Open
@thatcatcancode

Description

@thatcatcancode

Version info

Angular:
12.x.x

Firebase:
9.x.x

AngularFire:
7.x.x

Other (e.g. Ionic/Cordova, Node, browser, operating system):
Newly generated angular project with no SSR

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

Clone this repo and follow the README instructions

https://github.com/thatgirlcancode/angular-fire-issue

Steps to set up and reproduce

  1. npm install
  2. Add your Firebase environment config settings in app.module
  3. Run ng serve or npm run start and Navigate to http://localhost:4200/
  4. You will see in browser developer tools the error: Error: AngularFireModule has not been provided at getSchedulers

Sample data and security rules

Debug output

** Errors in the JavaScript console **
Error: AngularFireModule has not been provided at getSchedulers

** Output from firebase.database().enableLogging(true); **
undefined

** Screenshots **

Expected behavior

Firebase Realtime Database is configured and I'm able to use injection token in Firebase Service to query the database.

I have no issues configuring Firestore in this same way. I'm able to do this same provider/injection token pattern using initializeApp and getFirestore and it works beautifully. What is the difference with getDatabase?

Actual behavior

Error: AngularFireModule has not been provided at getSchedulers is thrown and the web page is blank.

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