角度 6:未定义运算符.share



我将我的 nativescript 项目升级到 Angular 6,但现在当我运行它时,我立即出现以下错误:

JS: bootstrap: ERROR BOOTSTRAPPING ANGULAR
JS: bootstrap: operators.share is not a function
JS:
JS: TypeError: operators.share is not a function
JS:     at new ApplicationRef (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:4446:67)
JS:     at _createClass (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:8210:20)
JS:     at _createProviderInstance$1 (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:8172:26)
JS:     at initNgModule (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:8108:32)
JS:     at new NgModuleRef_ (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:8831:9)
JS:     at createNgModuleRef (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:8820:12)
JS:     at Object.debugCreateNgModuleRef [as createNgModuleRef] (file:///data/data/io.neocles.dev/files/app/tns_modules/@angular/core/bundles/core.umd.js:10645:12)
JS:     at NgModuleFactory_.create (...

我升级到 rxjs 6,但仍然使用 rxjs-compat。我在根目录中包含一个名为"rxjs-operator"的文件,该文件导入了我使用的所有rxjs组件。共享不是其中之一,但将其添加到列表中不会改变任何东西。

我将错误追溯到core.umd.js中的以下位置:

this.isStable =
rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));

为什么我会收到此错误,如何解决?

将 NativeScript 升级到 Angular 6 后出现相同的错误。 就我而言,我运行的是错误的 NativeScript 版本 ->使用NativeScript > 4.1和最新的nativescript-angular版本。

最新更新