首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular 6:未定义operators.share

Angular 6:未定义operators.share
EN

Stack Overflow用户
提问于 2018-06-09 05:42:43
回答 1查看 392关注 0票数 3

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

代码语言:javascript
复制
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中的以下位置:

代码语言:javascript
复制
    this.isStable =
        rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));

为什么我会得到这个错误,我如何修复它?

EN

回答 1

Stack Overflow用户

发布于 2018-06-15 17:08:10

在将NativeScript升级到Angular 6之后,我也遇到了同样的错误。在我的例子中,我运行的是错误的NativeScript版本-->使用NativeScript > 4.1和最新的nativescript-angular版本。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50768750

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档