Closed glued closed 3 years ago
I'm unable to reproduce, are you using HMR?
no HMR
Haha, I have been creating a repro for this the last 3 hours, to find a bug raised 2 hours ago...
The way the issue manifests itself for me is when I use a combination of Lazy-Loaded Routes AND providing injection token SETTINGS. In the component from the lazy-loaded route, the (new injected instance of) AngularFirestore is trying to apply settings again to the firebase object (see constructor of AngularFirestore.ts).
In the repro, using the following versions yields the expected result.
But breaks when using the following versions (and beyond)
IMHO, the AngularFirestore should be a singleton service.
Here is a repro: https://stackblitz.com/edit/firestore-lazy-module-bug-repro?devtoolsheight=33&file=readme.md
Hope this helps...
I have the same problem on Angular 10.2.x and Angular Fire 6.0.x.
The scenario described by @athoma13 raises the same issue on my project.
Maybe, AngularFirestore can be providedIn: 'root'
or provided by AngularFirestoreModule. (code ref)
Addressed in #2667, this was the intent of my instance cache but I had an implementation error. 6.1.1 is being cut now with a fix.
@jamesdaniels May you backport it to 6.0.x, please?
After upgrading our project to 6.1.0 we started seeing this error
Version info
Angular: 11.0.1
Firebase: 8.0.2
AngularFire: 6.1.0
How to reproduce these conditions
removing settings fixes the issue...
Debug output
Errors in the JavaScript console
Expected behavior
no errors