angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.66k stars 2.19k forks source link

Cannot update @angular/fire from v7 to next version #3458

Open pbodlev opened 9 months ago

pbodlev commented 9 months ago

Version info

Angular: 16.2.12

Firebase:

AngularFire: 7.6.1

Other (e.g. Ionic/Cordova, Node, browser, operating system):

OS: MacOS Sonoma 14.0

How to reproduce these conditions

I am trying to update my angular version from 16.x up to 17. One of the prerequirements is to update @angular/fire up to v17.

 ng update
 Using package manager: yarn
 Collecting installed dependencies...
 Found 29 dependencies.
 We analyzed your package.json, there are some packages to update:

  Name                               Version                  Command to update
 --------------------------------------------------------------------------------
  @angular/cli                       16.1.8 -> 16.2.10        ng update @angular/cli
  @angular/core                      16.2.8 -> 16.2.12        ng update @angular/core
  @angular/fire                      7.6.1 -> 16.0.0          ng update @angular/fire

Debug output

I have tried to use ng update @angular/fire

but getting this error

Screenshot 2023-11-08 at 14 30 30

This one is expected, because there are versions between 7 and 17. However when I tried to install next version (16) it gives me same error. I also tried to update it to v8, but it seems that v8 do not exist according to https://www.npmjs.com/package/@angular/fire?activeTab=versions and also based on this issue.

Screenshot 2023-11-08 at 14 33 25

Expected behavior

Update @angular/fire to next version (v16)

Actual behavior

yarn think that next version is 8 but there is no such version

google-oss-bot commented 9 months ago

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

johalternate commented 9 months ago

I just had the same issue. Can't confirm but I believe the issue is because v7.6.1 and v16.0.0 are virtually the same version, so this would not be a real update. Anyway, as a workaround you can just change the version manually in package.json and run npm install.

pbodlev commented 9 months ago

I just had the same issue. Can't confirm but I believe the issue is because v7.6.1 and v16.0.0 are virtually the same version, so this would not be a real update. Anyway, as a workaround you can just change the version manually in package.json and run npm install.

I think issue is that for some reason npm (yarn) think that next version after 7 is 8 (simple increment). However next version is 16 and when I try to update @angular/fire to version 8 new error appears telling that there no such version, which is true.

Workaround works for me, thanx!

babsevensix commented 8 months ago

Hi, i have same problem too. If i try "ng update @angular/fire" I have this error: image

pbodlev commented 8 months ago

Hi, i have same problem too. If i try "ng update @angular/fire" I have this error: image

I have tried the workaround mentioned above and it works, so you can try same.

Vishal07MobileDev commented 7 months ago

Hi, I am having the below issue... when I am using Ionic 7, "@angular/cli": "^17.0.0", "@angular/fire": "^17.0.1", and "firebase": "10.7.2".

Please help to resolve this issue.

Error: node_modules/@angular/fire/compat/database/interfaces.d.ts:47:18 - error TS2430: Interface 'DatabaseSnapshotExists' incorrectly extends interface 'DataSnapshot'. [ng] Types of property 'forEach' are incompatible. [ng] Type '(action: (a: DatabaseSnapshot) => boolean) => boolean' is not assignable to type '(action: (a: IteratedDataSnapshot) => boolean | void) => boolean'. [ng] Types of parameters 'action' and 'action' are incompatible. [ng] Types of parameters 'a' and 'a' are incompatible. [ng] Type 'DatabaseSnapshot' is not assignable to type 'IteratedDataSnapshot'. [ng] Type 'DatabaseSnapshotExists' is not assignable to type 'IteratedDataSnapshot'. [ng] Types of property 'key' are incompatible. [ng] Type 'string | null' is not assignable to type 'string'. [ng] Type 'null' is not assignable to type 'string'. [ng] [ng] 47 export interface DatabaseSnapshotExists extends firebase.database.DataSnapshot { [ng] ~~~~~~ [ng] [ng] [ng] Error: node_modules/@angular/fire/compat/database/interfaces.d.ts:52:18 - error TS2430: Interface 'DatabaseSnapshotDoesNotExist' incorrectly extends interface 'DataSnapshot'. [ng] Types of property 'forEach' are incompatible. [ng] Type '(action: (a: DatabaseSnapshot) => boolean) => boolean' is not assignable to type '(action: (a: IteratedDataSnapshot) => boolean | void) => boolean'. [ng] Types of parameters 'action' and 'action' are incompatible. [ng] Types of parameters 'a' and 'a' are incompatible. [ng] Type 'DatabaseSnapshot' is not assignable to type 'IteratedDataSnapshot'. [ng] Type 'DatabaseSnapshotDoesNotExist' is not assignable to type 'IteratedDataSnapshot'. [ng] Types of property 'key' are incompatible. [ng] Type 'string | null' is not assignable to type 'string'. [ng] Type 'null' is not assignable to type 'string'. [ng] [ng] 52 export interface DatabaseSnapshotDoesNotExist extends firebase.database.DataSnapshot {