Angularfire: ERROR in ts(24,5): error TS2322: Type 'import("ClientApp/node_modules/@angular/fire/node_modules/rxjs/internal/Observable").Observable<any>' is not assignable to type 'import("ClientApp/node_modules/rxjs/internal/Observable").Observable<any>'.

Created on 4 May 2019  路  11Comments  路  Source: angular/angularfire

Deps:

  "dependencies": {
    "@angular/animations": "^8.0.0-rc.2",
    "@angular/cdk": "^8.0.0-rc.0",
    "@angular/common": "^8.0.0-rc.2",
    "@angular/compiler": "^8.0.0-rc.2",
    "@angular/core": "^8.0.0-rc.2",
    "@angular/fire": "^5.2.0-beta.2",
    "@angular/forms": "^8.0.0-rc.2",
    "@angular/http": "^8.0.0-beta.9",
    "@angular/material": "^8.0.0-rc.0",
    "@angular/platform-browser": "^8.0.0-rc.2",
    "@angular/platform-browser-dynamic": "^8.0.0-rc.2",
    "@angular/router": "^8.0.0-rc.2",
    "@types/core-js": "^2.5.0",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap": "^4.3.1",
    "core-js": "^3.0.1",
    "firebase": "^5.11.1",
    "hammerjs": "^2.0.8",
    "ngx-file-drop": "^6.0.0",
    "rxjs": "^6.0.0",
    "tslib": "^1.9.3",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.800.0-rc.2",
    "@angular/cli": "^8.0.0-rc.2",
    "@angular/compiler-cli": "^8.0.0-rc.2",
    "@angular/language-service": "^8.0.0-rc.2",
    "@types/jasmine": "^3.3.12",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^12.0.0",
    "codelyzer": "^5.0.1",
    "jasmine-core": "^3.4.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "^6.0.0",
    "ts-node": "^8.1.0",
    "tslint": "^5.16.0",
    "typescript": "^3.4.0"
  }

I'm trying to upgrade to the release candidate of angular 8. Apart from complaining about how angularfire2 doesn't support version 8 (when will there be a beta release which supports?) I'm also having this issue. My guess would be that the APIs of the rxjs which angularfire uses doesn't match with the version which I'm using.

I checked package.json of angularfire and I see that it's using 5.0.0 . I tried with both 5.0.0 and 5.6.1 in my repo and both reported this issue. I didn't have this problem prior to updating to angularfire 5.2.0 beta.2

This happens when I try using angular fire storage service

import { Injectable } from "@angular/core";
import { AngularFireStorage } from "@angular/fire/storage";
import { Observable } from "rxjs";

export interface HTMLInputEvent extends Event {
target: HTMLInputElement & EventTarget;
}

@Injectable()
export class FileStorageService {

  constructor(private storage: AngularFireStorage) {}

  public uploadFile(event: HTMLInputEvent, fileName: string) {
    if (event.target.files != null) {
      const file = event.target.files[0];
      const ref = this.storage.ref(fileName);

      ref.put(file);
    }
  }

  public getDownloadURL(fileName: string): Observable<any> {
    return this.storage.ref(fileName).getDownloadURL();
  }
}

Most helpful comment

@DominikDitoIvosevic I had the same issue. For some reason there were node_modules folder inside @angular/fire folder.

After deleting both node_modules and package-lock.json and doing npm install I was getting it working.
I had to also rename import from firebase/perf to firebase/performance in performance.module.js

All 11 comments

@DominikDitoIvosevic I had the same issue. For some reason there were node_modules folder inside @angular/fire folder.

After deleting both node_modules and package-lock.json and doing npm install I was getting it working.
I had to also rename import from firebase/perf to firebase/performance in performance.module.js

True. I had the same issue as you guys @diginikkari @DominikDitoIvosevic

@jamesdaniels The node_module folder is still being included in the package with "beta.4" and causing this error.

Weird... I'll take a peek at this. Thanks.

I bet it's something to do with how the test suite being run on our new CI/CD pipeline. I'll fix and release another beta.

Though I'm not seeing anything off in the tarball, curl $(npm view @angular/fire@next dist.tarball) | tar tvz doesn't show any node_modules or the sort...

2086

npm install brings the folder right back after deletion.

Annotation 2019-05-24 160008

Having the same issue with the latest RC

I have the same issue with 5.2.0-rc.1

Deps

"dependencies": {
    "@angular/common": "^7.2.10",
    "@angular/core": "^7.2.10",
    "@angular/fire": "^5.2.0-rc.1",
    "@angular/forms": "^7.2.10",
    "@angular/http": "^7.2.10",
    "@angular/platform-browser": "^7.2.10",
    "@angular/platform-browser-dynamic": "^7.2.10",
    "@angular/router": "^7.2.10",
    "@capacitor/android": "^1.0.0",
    "@capacitor/cli": "^1.0.0",
    "@capacitor/core": "1.0.0",
    "@capacitor/ios": "^1.0.0",
    "@ionic-native/call-number": "^5.6.1",
    "@ionic-native/camera": "^5.6.1",
    "@ionic-native/core": "^5.6.1",
    "@ionic-native/splash-screen": "^5.6.1",
    "@ionic-native/status-bar": "^5.6.1",
    "@ionic/angular": "^4.4.2",
    "core-js": "^2.6.5",
    "firebase": "6.1.0",
    "ionic-selectable": "^4.4.1",
    "rxjs": "~6.5.2",
    "sweetalert2": "^8.11.6",
    "tslib": "^1.9.3",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "^0.13.8",
    "@angular-devkit/core": "^7.2.10",
    "@angular-devkit/schematics": "^7.2.10",
    "@angular/cli": "^7.2.10",
    "@angular/compiler": "^7.2.10",
    "@angular/compiler-cli": "^7.2.10",
    "@angular/language-service": "^7.2.10",
    "@ionic/angular-toolkit": "~1.5.1",
    "@ionic/lab": "1.0.24",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^10.12.30",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.5",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "rxjs-tslint-rules": "^4.19.0",
    "ts-node": "^8.1.0",
    "tslint": "~5.16.0",
    "tslint-sonarts": "^1.9.0",
    "typescript": "^3.1.6 <3.2"
  },

This should be addressed in 5.2.0-rc.2

Was this page helpful?
0 / 5 - 0 ratings