Skip to content

angularfire 2 isn't working with Angular 6 #1602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cagline opened this issue May 7, 2018 · 10 comments
Closed

angularfire 2 isn't working with Angular 6 #1602

cagline opened this issue May 7, 2018 · 10 comments

Comments

@cagline
Copy link

cagline commented May 7, 2018

Firebase: 3.18.4
AngularFire: 5.0.0-rc.7
Angular CLI: 6.0.0
Angular: 6.0.0
Node: 8.9.4
OS: win32 x64

ERROR in node_modules/angularfire2/database/interfaces.d.ts(2,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Observable"' has no exported member 'Observable'.as no exported member 'Observable'.                                                                                                         no exported member 'Observable'.
node_modules/angularfire2/database/list/audit-trail.d.ts(2,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Observable"' has xported member 'Observable'.
no exported member 'Observable'.
node_modules/angularfire2/database/list/changes.d.ts(1,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/angularfire2/database/list/snapshot-changes.d.ts(1,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/angularfire2/database/list/state-changes.d.ts(2,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/angularfire2/database/observable/fromRef.d.ts(2,10): error TS2305: Module '"D:/findmyproperty/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/Subject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subject'.
src/app/core/auth/auth.service.ts(10,10): error TS2305: Module '"D:/findmyproperty/node_modules/rxjs/Subject"' has no exported member 'Subject'.
@hiepxanh
Copy link
Contributor

hiepxanh commented May 7, 2018

please, provide your package.json, maybe you missing something because we have some problem with rxjs upgrade

@cagline
Copy link
Author

cagline commented May 7, 2018

I fixed this issue by installing rxjs-compat
npm install --save rxjs-compat

update.angular.io
According to this rxjs-compat can be removed after all of your dependencies have updated to RxJS 6.

any way here is my package.json

"angularfire2": "^5.0.0-rc.7",
"firebase": "^4.13.1",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
{
  "name": "findmyproperty",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.0",
    "@angular/cdk": "^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/material": "^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.4.1",
    "firebase": "^4.13.1",
    "rxjs": "^6.1.0",
    "rxjs-compat": "^6.1.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "6.0.0",
    "@angular/compiler-cli": "6.0.0",
    "@angular/language-service": "6.0.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "2.7.2",
    "@angular-devkit/build-angular": "~0.6.0"
  }
}

@hiepxanh
Copy link
Contributor

hiepxanh commented May 7, 2018

yes, that exactly what I'm going to talk with you @cagline . but I want to make sure that you missing rxjs-compat. should we left this repository open then make an update in angularfire2 to includes rxjs-compat or close it and we update directly our library to rxjs 6 without includes rxjs-compat? @davideast

@cagline
Copy link
Author

cagline commented May 7, 2018

update.angular.io
According to this rxjs-compat can be removed after all of your dependencies have updated to RxJS 6.
for now i think you can make an update inangularfire2to includes rxjs-compat

image

@hiepxanh
Copy link
Contributor

hiepxanh commented May 7, 2018

yeah, that right 😄 maybe @jamesdaniels can make an small update for this issue

@SebastianPodgajny
Copy link

rxjs-compat is not meant to be used in libraries...

@jamesdaniels
Copy link
Member

Fixed in angularfire2@next

@FouomaOscar
Copy link

That is my code example fine https://github.com/FouomaOscar/firebase-authentication-with-angular-6. It's works fine

@matthewharwood
Copy link

Yeah I had to install angularfire2@next to remove these errors

@jdevsan
Copy link

jdevsan commented Jul 21, 2018

People im getting this error! please helppp!

ERROR in src/app/feed/feed.component.ts(6,10): error TS2305: Module '"/Users/joecastro/Desktop/angular/base-chat/node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'.
src/app/services/chat.service.ts(56,37): error TS2345: Argument of type '{ query: { limitToLast: number; orderByKey: boolean; }; }' is not assignable to parameter of type 'FirebaseListFactoryOpts'.
Types of property 'query' are incompatible.
Type '{ limitToLast: number; orderByKey: boolean; }' is not assignable to type 'Query'.
Property 'endAt' is missing in type '{ limitToLast: number; orderByKey: boolean; }'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants