【问题标题】:export 'partition' was not found in 'rxjs'在“rxjs”中找不到导出“分区”
【发布时间】:2019-12-24 08:21:31
【问题描述】:

我正在尝试在我的 Angular 项目中使用 ng-http-loader。我已经安装了 ng-http-loader 包。编译项目时出现错误。错误是

在“rxjs”中找不到导出“分区”。

package.json

"dependencies": {
  "@angular/animations": "^8.2.2",
  "@angular/cdk": "^8.1.3",
  "@angular/common": "~8.0.0",
  "@angular/compiler": "~8.0.0",
  "@angular/core": "~8.0.0",
  "@angular/forms": "~8.0.0",
  "@angular/material": "^8.1.3",
  "@angular/platform-browser": "~8.0.0",
  "@angular/platform-browser-dynamic": "~8.0.0",
  "@angular/router": "~8.0.0",
  "hammerjs": "^2.0.8",
  "ng-http-loader": "^6.0.1",
  "rxjs": "^6.5.2",
  "tslib": "^1.9.0",
  "zone.js": "~0.9.1"
},

【问题讨论】:

  • 你能显示你的 package.json 吗?
  • 您可以edit您的问题,请不要在cmets中发布代码
  • 在 stackblitz 上重现错误这个问题发生在 RxJS 版本低于 6.5.0 而你的版本高于此。
  • 将 RxJS 版本升级到 6.5.3 对我有用。 npm i rxjs@6.5.3

标签: javascript angular npm rxjs


【解决方案1】:

转到 ng-http-loader.js。您可以看到以下内容

import { ReplaySubject,partition, merge, timer } from 'rxjs';
import { finalize, switchMap, debounce, distinctUntilChanged, tap} from 
'rxjs/operators';

你只需要把它们改成这样:

import { ReplaySubject, merge, timer } from 'rxjs';
import { finalize, switchMap, debounce, distinctUntilChanged, tap, partition } 
from 'rxjs/operators';

【讨论】:

    【解决方案2】:

    ng-http-loader.js 没有这样的导入

    【讨论】:

      猜你喜欢
      • 2019-10-23
      • 2022-12-21
      • 2016-06-29
      • 2017-01-06
      • 2010-09-17
      • 1970-01-01
      • 2020-09-15
      • 2018-02-03
      • 2020-01-19
      相关资源
      最近更新 更多