Angularfire: RXJS 6 compatibility

Created on 30 Mar 2018  Â·  18Comments  Â·  Source: angular/angularfire

Version info

Angular: 6.0.0-rc.0

Firebase: 4.12.0

AngularFire: 5.0.0-rc.6

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

    "rxjs": "6.0.0-beta.3",
    "rxjs-compat": "6.0.0-beta.1",

How to reproduce these conditions

ng serve fails with following error

ERROR in ./node_modules/angularfire2/database/observable/fromRef.js
Module not found: Error: Can't resolve 'rxjs/operator/observeOn' in 'C:\Development\profile-web\node_modules\angularfire2\database\observable'

in the fromRef.js file needs to be fixed import
import { observeOn } from 'rxjs/operator/observeOn';
to
import { observeOn } from 'rxjs/operators/observeOn';

Most helpful comment

We should have a next release soon.

All 18 comments

I actually think it would be import { observeOn } from 'rxjs/operators

Would be nice to get even some @next release for this. I can see that there was already changes made that removed the usage of observeOn so some sort of pre-release would allow us to start migrating to Angular 6.

We should have a next release soon.

Perhaps because of the RxJS version change, there seems to be a greater than usual level of activity around the Angular community aiming to have version 6 compatibility very close to the version 6 ship date. It would be great to see Angularfire2 come along for this ride.

Hi
I see in npm version 5.0.0-rc.7.0-next published 4 days ago
After upgrading to angular 6 rc and rxjs 6, and angularfire 5.0.0-rc.7.0-next I still have the errors in angularfire related to use of old rxjs functions

Module not found: Error: Can't resolve 'rxjs/add/operator/mergeMap'
ERROR in ./node_modules/angularfire2/database/list/changes.js

Did I miss something? wasn't the next version supposed to be based on the new rxjs version? like angular 6 rc?
I started the migration of my project to angular 6 rc but I'm stuck because of angularfire :(

@rurziceanu
I think we have to wait for v6.next release.

Is there release date for the v6.next? because angular v6 is now at release candidate 5.. and no angularfire2 package since now for v6.. all other dependencies are up to date.. :(
I have only angularfire2 to migrate

rxjs just release 6.0 stable. They included a migration script to avoid the compat-layer.

@larssin That is quite interesting, it is the first suggestion I have seen (among many discussions!) to run Angular 6 with RxJS 5 forward-compat. This is a great workaround until Angularfire gets updated.

update to RxJS 6 soon!

Any updates on this topic?? This renders AngularFire2 useless with the new version of angular

@rojasjandro89 Temporary it works with rxjs-compat package and Angular 6. But yes, we are all eager for the new version.

I can see it compiles just fine now. But it's giving me another error now. After I install the compat package I can't map or even subscribe to AngularFirestoreCollection.snapshotChanges() to get the document id:

image

I get the following error in console:
image

This is my package.json:
{ "name": "support-portal", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^6.0.0", "@angular/common": "^6.0.0", "@angular/compiler": "^6.0.0", "@angular/core": "^6.0.0", "@angular/forms": "^6.0.0", "@angular/http": "^6.0.0", "@angular/platform-browser": "^6.0.0", "@angular/platform-browser-dynamic": "^6.0.0", "@angular/router": "^6.0.0", "angularfire2": "^5.0.0-rc.7", "core-js": "^2.5.4", "firebase": "^5.0.1", "rxjs": "^6.0.0", "rxjs-compat": "^6.1.0", "zone.js": "^0.8.26" }, "devDependencies": { "@angular/compiler-cli": "^6.0.0", "@angular-devkit/build-angular": "~0.6.0", "typescript": "~2.7.2", "@angular/cli": "~6.0.0", "@angular/language-service": "^6.0.0", "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~1.4.2", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tslint": "~5.9.1" }, "prettier": { "printWidth": 250 } }
Is anybody else having this problem?

Please stick with Firebase JS SDK 4.x for now, we're working on 5.0
compatibility but there are a number of breaking changes.

On Thu, May 10, 2018, 5:52 AM rojasjandro89 notifications@github.com
wrote:

I can see it compiles just fine now. But it's giving me another error now.
After I install the compat package I can't map and
AngularFirestoreCollection.snapshotChanges() to get the document id:

[image: image]
https://user-images.githubusercontent.com/17559789/39870379-2e89c9b6-542f-11e8-81cb-f7039a6f791f.png

I get the following error in console:
[image: image]
https://user-images.githubusercontent.com/17559789/39870176-59a48e34-542e-11e8-8f71-e3e0e55ec28c.png

This is my package.json:
{ "name": "support-portal", "version": "0.0.0", "scripts": { "ng": "ng",
"start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng
lint", "e2e": "ng e2e" }, "private": true, "dependencies": {
"@angular/animations": "^6.0.0", "@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0", "@angular/core": "^6.0.0", "@angular/forms":
"^6.0.0", "@angular/http": "^6.0.0", "@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0", "@angular/router": "^6.0.0",
"angularfire2": "^5.0.0-rc.7", "core-js": "^2.5.4", "firebase": "^5.0.1",
"rxjs": "^6.0.0", "rxjs-compat": "^6.1.0", "zone.js": "^0.8.26" },
"devDependencies": { "@angular/compiler-cli": "^6.0.0",
"@angular-devkit/build-angular": "~0.6.0", "typescript": "~2.7.2",
"@angular/cli": "~6.0.0", "@angular/language-service": "^6.0.0",
"@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node":
"~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter":
"~1.4.2", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter":
"^0.2.2", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tslint": "~5.9.1"
}, "prettier": { "printWidth": 250 } }
Is anybody else having this problem?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/angular/angularfire2/issues/1538#issuecomment-388043540,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACvryZPp3HLw6-6CqCr1DNMkP_6sOdHks5txDgpgaJpZM4TBW5s
.

Fixed in angularfire2@next

@jamesdaniels Please look at @rojasjandro89 issue, I am facing the same issue, cant map to read firestore after update angular 6.

Angularfire2@next doesnt fix.

angular 8 , rxjs 6.4 . angularfire 5.2.3 - got ther error
ERROR in node_modules/rxjs/internal/symbol/observable.d.ts(4,18): error TS2687: All declarations of 'observable' must have identical modifiers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

martinyoussef picture martinyoussef  Â·  3Comments

itisparas picture itisparas  Â·  3Comments

jnupeter picture jnupeter  Â·  3Comments

sharomet picture sharomet  Â·  3Comments

harrylincoln picture harrylincoln  Â·  3Comments