Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thatcatcancode opened this issue Oct 6, 2021 · 4 comments

Comments

@thatcatcancode
Copy link

thatcatcancode commented Oct 6, 2021

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.

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@thatcatcancode
Copy link
Author

This is a follow up to this discussion: #2990

@jakehockey10
Copy link

I'm also having this issue. I'm using authState method to capture the user as an observable in my service, and I can't get the tests to get passed this error.

Are there examples somewhere of tests that have been written for components that depend on these methods from the version 7 of the library?

@alerena
Copy link

alerena commented Jul 10, 2023

Any news on this? I'm stuck with the same problem but with authState like @jakehockey10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants