Angularfire: bug: release 5.1.0 has incorrect dependency

Created on 29 Oct 2018  路  7Comments  路  Source: angular/angularfire

Version info

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.

Debug output

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'.

Expected behavior

Building an app using @angular/fire works normally using minimum required dependency versions as specified in package.json.

Actual behavior

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).

Expected fix

Update @angular/fire package.json so that the minimum required version of "firebase" is "^5.5.3"

All 7 comments

Update

@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]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itisparas picture itisparas  路  3Comments

KLiFF2606 picture KLiFF2606  路  3Comments

goekaypamuk picture goekaypamuk  路  3Comments

StephenFluin picture StephenFluin  路  3Comments

Maistho picture Maistho  路  3Comments