Rxjs error

#1

Hi

I am using RXJS in my ionic 3 app. I deleted the node_modules directory and resinstalled all dependencies (this project is using yarn), and now I get this error:

__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.combineLatest is not a function

image

#2

I’m curious what version of rxjs you’ve gotten, but regardless I would suggest reading this.

#3

Hi,

I have to mention that I don’t explicityly use .combineLatest, it is used by the rxjs errors in html, like this:

     <div class="form-error" ngxErrors="password" #passwordErrors="ngxErrors">
        <div [ngxError]="['minlength', 'required']" [when]="['touched']">6 caractères minimum</div>
      </div>

In package.json there is: “rxjs”: “^6.2.2”
Here’s what I get when I do $ yarn install:

$ yarn install
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
warning angularfire2@5.1.1: AngularFire has moved, we're now @angular/fire
warning cordova-browser > path-is-absolute@2.0.0: This package is no longer relevant as Node.js 0.12 is unmaintained.
warning cordova-plugin-ionic > @types/cordova-plugin-file-transfer@1.6.2: This is a stub types definition for cordova-plugin-file-transfer (https://github.com/apache/cordova-plugin-file-transfer). cordova-plugin-file-transfer provides its own type definitions, so you don't need @types/cordova-plugin-file-transfer installed!
warning @ionic/app-scripts > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @ionic/app-scripts > node-sass > request > hawk > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
warning @ionic/app-scripts > node-sass > request > hawk > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning @ionic/app-scripts > node-sass > request > hawk > boom > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning @ionic/app-scripts > node-sass > request > hawk > sntp > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning @ionic/app-scripts > node-sass > request > hawk > cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
warning @ionic/app-scripts > node-sass > request > hawk > cryptiles > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @angular/common@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/core@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/forms@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @angular/http@5.2.9" has incorrect peer dependency "rxjs@^5.5.0".
warning " > @ionic-native/camera@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/camera@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/core@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > @ionic-native/email-composer@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/email-composer@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/fcm@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/fcm@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/geolocation@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/geolocation@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/http@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/http@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/push@4.18.0" has incorrect peer dependency "@ionic-native/core@^4.11.0".
warning " > @ionic-native/push@4.18.0" has incorrect peer dependency "rxjs@^5.5.11".
warning " > @ionic-native/splash-screen@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > @ionic-native/status-bar@4.5.3" has incorrect peer dependency "rxjs@^5.0.1".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/compiler@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/common@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "@angular/core@^6.0.0".
warning " > angular-svg-round-progressbar@2.0.0" has unmet peer dependency "core-js@^2.4.1".
warning " > angular-svg-round-progressbar@2.0.0" has incorrect peer dependency "zone.js@^0.8.26".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/common@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/core@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/platform-browser@>=6.0.0 <8".
warning "angularfire2 > @angular/fire@5.1.1" has incorrect peer dependency "@angular/platform-browser-dynamic@>=6.0.0 <8".
warning "firebase > @firebase/storage@0.2.4" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/storage > @firebase/storage-types@0.2.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/database@0.3.8" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/database > @firebase/database-types@0.3.2" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore@0.9.1" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/messaging@0.3.7" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/messaging > @firebase/messaging-types@0.2.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/auth > @firebase/auth-types@0.5.0" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore > @firebase/firestore-types@0.8.0" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/functions@0.3.3" has unmet peer dependency "@firebase/app-types@0.x".
warning " > ng2-charts-x@2.0.6" has incorrect peer dependency "rxjs@^5.1.0".
warning " > ng2-charts-x@2.0.6" has unmet peer dependency "moment@^2.18.1".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 59.84s.

Any idea what’s going on?

#4

Hello,

maybe same like here TypeError: Object(...) is not a function

You should update your package.json to correct dependencies.

Best regards, anna-liebt

#5

Hello, thanks, but I already have rxjs 6 and rxjs-compat.
It seems my issue is the same as here: https://stackoverflow.com/questions/53674364/rxjs-6-3-3-ionic-typeerror-observable-combinelatest-is-not-a-function

#6

you dont need compat anymore with 6

#7

I see many typescript errors if I remove rxjs-compat

#8

Observable needs to import from rxjs only
import { Observable } from ‘rxjs’;

Edit:
httphandler needs to import from common/http

import { HttpHandler,} from '@angular/common/http'