angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Current versions of angularfire2 not compatible with the new angular v6 stable release

Open ElecTreeFrying opened this issue 8 years ago • 30 comments

Version info

Firebase: 4.13.1

AngularFire: 5.0.0-rc.6.0

Debug output

My dry run installation of angular v6 and material/cdk v6

angularfire2

npm WARN [email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of rxjs@^5.5.4 but none is installed. You must install peer dependencies yourself.

Actual behavior

  peerDependencies:
   { '@angular/common': '^5.0.0',
     '@angular/core': '^5.0.0',
     '@angular/platform-browser': '^5.0.0',
     '@angular/platform-browser-dynamic': '^5.0.0',
     '@firebase/app': '^0.1.6',
     rxjs: '^5.5.4',
     'zone.js': '^0.8.0' },

Personal statement

Okay. So I've been waiting for the next release of angularfire2 since material2 6.0.0-beta-0. I am stuck at ghillie-soup, cant use new features of 6 beta and up with the current angularfire2 @next and @latest versions.

Please release another version that will make angularfire2 compatible with angular/cdk/material v6.

ElecTreeFrying avatar May 04 '18 12:05 ElecTreeFrying

This is a peer dep warning and it should still work despite the warnings. We will be pushing an update soon.

davideast avatar May 04 '18 14:05 davideast

Following are runtime exception using AoT build on angular6 project @firebase/database: FIREBASE WARNING: Exception was thrown by user callback. TypeError: Cannot read property 'OVERWRITE' of undefined

Uncaught TypeError: Cannot read property 'OVERWRITE' of undefined

vincent-cm avatar May 04 '18 15:05 vincent-cm

@vincent-cm That is indicative of passing undefined to a Firebase update operation. I need more information to tell if it's an issue caused by a conflict with Angular 6. Please file another issue with a repro and we'll take a look.

davideast avatar May 04 '18 15:05 davideast

I experienced the same issue after running ng update @angular/core, which prevented the operation from running successfully :

ngupdateangularfire2

tayambamwanza avatar May 04 '18 15:05 tayambamwanza

@davideast https://github.com/vincent-cm/angular-starter-test This can reproduce Cannot read property 'OVERWRITE' of undefined Please run: npm run build:aot and npm run serve:prod to locate the runtime error

vincent-cm avatar May 04 '18 19:05 vincent-cm

Hi @vincent-cm! Can you please open a new issue? It makes it much easier to track. Also, I recommend creating a Stackblitz.com example. That way it's much easier for us to collaborate.

davideast avatar May 04 '18 19:05 davideast

I'm getting a straight error with ng serve

ERROR in node_modules/angularfire2/angularfire2.d.ts(3,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/angularfire2/auth/auth.d.ts(3,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/interfaces.d.ts(2,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/list/audit-trail.d.ts(2,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/list/changes.d.ts(1,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/list/snapshot-changes.d.ts(1,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/list/state-changes.d.ts(2,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/observable/fromRef.d.ts(2,10): error TS2305: Module '"/projects/blog/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
node_modules/rxjs/Subscription.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subscription'.

bluebaroncanada avatar May 04 '18 19:05 bluebaroncanada

@bluebaroncanada did u install npm install rxjs@6 rxjs-compat@6 --save?

vincent-cm avatar May 04 '18 20:05 vincent-cm

@vincent-cm after trying & serving I'm getting:

ERROR in node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2720: Class 'FirebaseApp' incorrectly implements class 'FirebaseApp'. Did you mean to extend 'FirebaseApp' and inherit its members as a subclass?
  Property 'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'.

i 「wdm」: Failed to compile.

lewiswashere avatar May 04 '18 20:05 lewiswashere

@vincent-cm You're a gentleman and a scholar. Thanks.

bluebaroncanada avatar May 04 '18 20:05 bluebaroncanada

@lewiswashere you can try to downgrade the firebase version

vincent-cm avatar May 04 '18 20:05 vincent-cm

@lewiswashere RC7 has a fix for that issue. #1574

RC7 Install Command yarn add [email protected] or npm install --save [email protected]

BrandonCravener avatar May 04 '18 20:05 BrandonCravener

@BrandonCravener thanks!

lewiswashere avatar May 04 '18 21:05 lewiswashere

I am also having the same issue with angularfire2 with the latest Angular 6 release. I tried the npm install --save [email protected] but did not work for me.

ERROR in src/app/app.component.ts(9,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/app.component.ts(9,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/contractor/contractor.component.ts(8,10): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/contractor/contractor.component.ts(8,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/contractor/contractor.component.ts(45,5): error TS2322: Type '[string, string, string, string, string, string, string, string]' is not assignable to type '[any]'.
  Types of property 'length' are incompatible.
    Type '8' is not assignable to type '1'.
src/app/contractor/contractor.component.ts(72,13): error TS2345: Argument of type '{ query: { orderByChild: string; }; }' is not assignable to parameter of type 'QueryFn'.
  Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'.
src/app/portfolio/portfolio.component.ts(6,10): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/portfolio/portfolio.component.ts(6,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/portfolio/portfolio.component.ts(49,13): error TS2345: Argument of type '{ query: { orderByChild: string; }; }' is not assignable to parameter of type 'QueryFn'.
  Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'.
src/app/property-flip-or-hold/property-flip-or-hold.component.ts(15,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/property-flip-or-hold/property-flip-or-hold.component.ts(15,57): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/property-flip-or-hold/property-flip-or-hold.component.ts(28,25): error TS2307: Cannot find module '@angular/core/src/animation/dsl'.
src/app/property-flip-or-hold/property-flip-or-hold.component.ts(189,46): error TS2339: Property 'subscribe' does not exist on type 'AngularFireObject<{}>'.
src/app/property-list/property-list.component.ts(6,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/property-list/property-list.component.ts(6,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/property-list/property-list.component.ts(80,5): error TS2322: Type '[string, string, string, string, string, string, string]' is not assignable to type '[any]'.
  Types of property 'length' are incompatible.
    Type '7' is not assignable to type '1'.
src/app/property-list/property-list.component.ts(95,13): error TS2345: Argument of type '{ query: { orderByChild: string; }; }' is not assignable to parameter of type 'QueryFn'.
  Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'.
src/app/property-list/property-list.component.ts(117,13): error TS2345: Argument of type '{ query: { orderByChild: string; equalTo: string; }; }' is not assignable to parameter of type 'QueryFn'.
  Object literal may only specify known properties, and 'query' does not exist in type 'QueryFn'.
src/app/services/auth.service.ts(9,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/auth.service.ts(9,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/services/contractor.service.ts(6,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/contractor.service.ts(6,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/services/portfolio.service.ts(6,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/portfolio.service.ts(6,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/services/property.service.ts(6,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/property.service.ts(6,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/services/user.service.ts(5,31): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/user.service.ts(5,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.
src/app/user-profile/user-profile.component.ts(8,10): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/user-profile/user-profile.component.ts(8,55): error TS2305: Module '"/Users/marco/Documents/Pixolini/Angular6 Development/PropertyFlipOrHold-Angular6/node_modules/angularfire2/database/index"' has no exported member 'FirebaseObjectObservable'.

ℹ 「wdm」: Failed to compile.

Sun3 avatar May 04 '18 21:05 Sun3

@Sun3 If you are upgrading from a verison prior to 5.0.0 checkout the 5.0 upgrade guide.

BrandonCravener avatar May 04 '18 21:05 BrandonCravener

@davideast I have the same issue as @davideast , I created a new issue https://github.com/angular/angularfire2/issues/1596

Ploppy3 avatar May 05 '18 01:05 Ploppy3

@BrandonCravener Thanks.

Sun3 avatar May 05 '18 04:05 Sun3

should we run ng update for the angularfire2 project 😃

hiepxanh avatar May 05 '18 05:05 hiepxanh

I honestly dont know about peer dep warnings your talking about @davideast until now 😁 I always take per ders seriously.

I have the same issue as @bluebaroncanada and @Sun3

npm install rxjs@6 rxjs-compat@6 --save replied by @vincent-cm resolved my issue. can now use ng/m2/cdk v6 along with af2. Ill close the issue.

ElecTreeFrying avatar May 05 '18 06:05 ElecTreeFrying

Is the package gonna be updated to not need rxjs-compat ?

cedvdb avatar May 11 '18 15:05 cedvdb