我将我的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 -operators“的文件,它导入了我使用的所有rxjs组件。share不是其中之一,但将其添加到列表中并不会改变任何事情。
我将这个错误追溯到core.umd.js中的以下位置:
this.isStable =
rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));为什么我会得到这个错误,我如何修复它?
发布于 2018-06-15 17:08:10
在将NativeScript升级到Angular 6之后,我也遇到了同样的错误。在我的例子中,我运行的是错误的NativeScript版本-->使用NativeScript > 4.1和最新的nativescript-angular版本。
https://stackoverflow.com/questions/50768750
复制相似问题