Angularfire: @firebase/firestore: Firestore (5.8.0): timestampsInSnapshots

Created on 18 Jan 2019  路  13Comments  路  Source: angular/angularfire

Version info

Angular: 7.2.1

Firebase: 5.8.0

AngularFire: 5.1.1

In the newest firebase version the timestampsInSnapshots setting defaults to true therefore it no longer needs to be set. This causes error/warning message in the browser console:

[2019-01-18T11:01:29.267Z] @firebase/firestore: Firestore (5.8.0): The timestampsInSnapshots setting now defaults to true and you no longer need to explicitly set it. In a future release, the setting will be removed entirely and so it is recommended that you remove it from your firestore.settings() call now.

Most helpful comment

eg: app.module.ts
import { AngularFirestoreModule, FirestoreSettingsToken } from '@angular/fire/firestore'; @NgModule({ declarations: [AppComponent], imports: [ ... AngularFirestoreModule, ... ], providers: [{ provide: FirestoreSettingsToken, useValue: {} }], bootstrap: [AppComponent] }) export class AppModule { }

All 13 comments

I am new to angularfire2 and following the installation and setup guide I kept getting this error. I'm not sure if this error is preventing the code from working or if I'm just doing something wrong.

It doesn't seem like this is stopping any development for you, if it is you can explicitly change the version of firebase in your package.json.
image

@Marcusg62

Until @angular/fire is updated, there should be no harm in clearing that setting yourself.

Wherever you import AngularFirestoreModule...

import { FirestoreSettingsToken } from '@angular/fire/firestore';

...

{ provide: FirestoreSettingsToken, useValue: {} }

eg: app.module.ts
import { AngularFirestoreModule, FirestoreSettingsToken } from '@angular/fire/firestore'; @NgModule({ declarations: [AppComponent], imports: [ ... AngularFirestoreModule, ... ], providers: [{ provide: FirestoreSettingsToken, useValue: {} }], bootstrap: [AppComponent] }) export class AppModule { }

this seems to work for everyone but i still show the error.

I imported import { AngularFirestoreModule, FirestoreSettingsToken } from '@angular/fire/firestore';

then

providers: [
   { provide: FirestoreSettingsToken, useValue: {} },
   { provide: 'SnotifyToastConfig', useValue: ToastDefaults}
]

is it possible the fix is different for RealTime Database? Here is my error

[2019-04-02T16:03:38.567Z] @firebase/firestore: Firestore (5.9.1):
The timestampsInSnapshots setting now defaults to true and you no
longer need to explicitly set it. In a future release, the setting
will be removed entirely and so it is recommended that you remove it
from your firestore.settings() call now.

These workarounds are still necessary?

I already updated to "@angular/fire": "^5.1.2" and "firebase": "^5.10.1" and still get these warnings in console:

console.js:35 [2019-04-30T14:17:24.788Z]  @firebase/firestore: Firestore (5.10.0): 
  The timestampsInSnapshots setting now defaults to true and you no
  longer need to explicitly set it. In a future release, the setting
  will be removed entirely and so it is recommended that you remove it
  from your firestore.settings() call now.

These workarounds are still necessary?

I already updated to "@angular/fire": "^5.1.2" and "firebase": "^5.10.1" and still get these warnings in console:

console.js:35 [2019-04-30T14:17:24.788Z]  @firebase/firestore: Firestore (5.10.0): 
  The timestampsInSnapshots setting now defaults to true and you no
  longer need to explicitly set it. In a future release, the setting
  will be removed entirely and so it is recommended that you remove it
  from your firestore.settings() call now.

same issue here

It seems like it's fixed with version "@angular/fire": "^5.1.3"

I don't see 5.1.3 in their changelog for @angular/fire

FirestoreSettingsToken was replaced by SETTINGS in v6.0
see: https://github.com/angular/angularfire/blob/master/CHANGELOG.md

Ok @assafsl, thank you, this is the link : https://github.com/angular/angularfire/blob/master/CHANGELOG.md#angularfirefirestore
But how I can fix this ?

Ok @assafsl, thank you, this is the link : https://github.com/angular/angularfire/blob/master/CHANGELOG.md#angularfirefirestore
But how I can fix this ?

same problem here, I couldn't find any clue....

Ok @assafsl, thank you, this is the link : https://github.com/angular/angularfire/blob/master/CHANGELOG.md#angularfirefirestore
But how I can fix this ?

Ok, It's seem that I can import SETTINGS from firestore
import { SETTINGS } from '@angular/fire/firestore';

Was this page helpful?
0 / 5 - 0 ratings