ionic - ошибка RXJS: rxjs_Observable __. Observable.combineПоследний не является функцией - PullRequest
0 голосов
/ 20 декабря 2018

с моим приложением Ionic 3.9 я получаю эту ошибку: __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.combineLatest is not a function при запуске ionic serve в браузере.

У меня была ошибка плагинов, поэтому я удалил node_modules, yarn.lock и переустановилвсе зависимости через $ yarn install.

ERROR TypeError: __WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.combineLatest is not a function
    at NgxErrorDirective.ngOnInit (ngxerror.directive.js:40)
    at checkAndUpdateDirectiveInline (core.js:12369)
    at checkAndUpdateNodeInline (core.js:13893)

Вот мой конфиг:

$ ionic info

Ionic:

   ionic (Ionic CLI)  : 4.6.0
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.0.0, browser 5.0.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, (and 5 other plugins)

System:

   Android SDK Tools : 25.2.5 (/home/louisro/android-sdk-linux/)
   NodeJS            : v8.9.4 (/home/louisro/.nvm/versions/node/v8.9.4/bin/node)
   npm               : 5.6.0
   OS                : Linux 4.4

Вот что дал $ 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.
[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/functions@0.3.3" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/functions > @firebase/messaging-types@0.2.3" 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.7" 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/auth > @firebase/auth-types@0.5.0" has unmet peer dependency "@firebase/app-types@0.x".
warning "firebase > @firebase/firestore@0.9.0" 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/firestore > @firebase/firestore-types@0.8.0" 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 72.88s.

Ответы [ 2 ]

0 голосов
/ 21 декабря 2018

Как говорит пряжа: у вас неверные зависимости от пира.

Я вижу, вы пытаетесь установить пакет @angular/fire@5.1.1, для которого требуется @angular/common@>=6.0.0.Это также означает обновление всех ваших @angular/* и rxjs зависимостей до 6.0.0 или более.

Вы также должны заметить, что между rxjs 6 и предыдущей версией есть некоторые серьезные изменения (ваша комбинацияПоследняя ошибкаможет прийти отсюда).Вы также можете установить rxjs-compat, чтобы сохранить код как есть.

Надеюсь, это поможет.

0 голосов
/ 20 декабря 2018

Похоже, есть проблема Observable.combineLatest.Трудно предположить, не видя код, но, скорее всего, если вы импортируете Observable, вам также нужно импортировать объединение, последнее тоже самое, как это

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/combineLatest';

Надеюсь, это сработает.

...