Angular: 6.1.9
Firebase: 5.5.2
AngularFire: 5.1.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): Google Chrome 69
Steps to set up and reproduce
Install "@angular/fire": "5.1.0" with "firebase": "5.5.2" and attempt to build app.
Using "@angular/fire": "5.1.0" with "firebase": "5.5.2" (note the pinned version numbers) results in the following error:
ERROR in node_modules/@angular/fire/firestore/firestore.d.ts(9,73): error TS2694: Namespace 'firebase.firestore' has no exported member 'PersistenceSettings'.
node_modules/@angular/fire/firestore/interfaces.d.ts(6,53): error TS2694: Namespace 'firebase.firestore' has no exported member 'PersistenceSettings'.
Building an app using @angular/fire works normally using minimum required dependency versions as specified in package.json.
The @angular/fire package.json specifies that "firebase": "^5.5.0" is required when, in reality, "firebase": "^5.5.3" is required.
Using "@angular/fire": "5.1.0" with "firebase": "5.5.2" results in the following error:
ERROR in node_modules/@angular/fire/firestore/firestore.d.ts(9,73): error TS2694: Namespace 'firebase.firestore' has no exported member 'PersistenceSettings'.
node_modules/@angular/fire/firestore/interfaces.d.ts(6,53): error TS2694: Namespace 'firebase.firestore' has no exported member 'PersistenceSettings'.
The problem is that "@angular/fire": "5.1.0" expects typings for PersistanceSettings to be exported from "firebase" but "firebase": "5.5.2" does not export these typings. These typings are exported from "firebase" starting with version "^5.5.3". See relevant PR https://github.com/firebase/firebase-js-sdk/pull/1278.
(on a side note, the "firebase" changelogs are very unclear. I ended up just using trial and error to figure out that 5.5.3 was the first release which exported the PersistanceSettings types).
Update @angular/fire package.json so that the minimum required version of "firebase" is "^5.5.3"
@angular/fire appears to also not be compatible with "firebase": "5.5.6", as that release moved the typing files around.
It appears that "@angular/fire": "5.1.0" expects "firebase": ">=5.5.3 <5.5.6".
I don't know if we want to put ourselves in the position of capturing every bug with the JS SDK in our package.json, @davideast @mikelehen thoughts?
If Firebase JS SDK is breaking on minors, that's a bug.
I agree that the decision in firebase 5.5.6 to move typings around should be considered a bug, but I don't think the addition of the PersistanceSettings type to 5.5.3 should be considered a bug.
I agree.
Whaaat? Types were moved around? I have no context on this.
If there are bugs in the JS SDK, definitely please log them on the JS SDK repo. Angularfire should not work around them.
Looks like this has been fixed with [email protected]