gpt4 book ai didi

angular - 无法解析 'rxjs-compat/observable/combineLatest'

转载 作者:行者123 更新时间:2023-12-02 20:09:41 26 4
gpt4 key购买 nike

我已将我的 Angular 项目升级为

"rxjs": "^6.3.3"

我使用了combineLatest运算符,但升级后遇到问题,编译失败

ERROR in ./node_modules/rxjs/observable/combineLatest.js
Module not found: Error: Can't resolve 'rxjs-compat/observable/combineLatest' in 'D:\MyProject\node_modules\rxjs\observable'

我正在导入

import { map, distinctUntilChanged, filter, combineLatest } from "rxjs/operators";

即使我已经更新了语法

_col$.pipe(combineLatest(this.meta$.asObservable()))

我需要安装rxjs-compat吗?

但是我read this

rxjs-compat provides a temporary compatibility layer between the APIs of v5 and v6. Essentially, rxjs-compat provisions your codebase with functionality from v5 that it relies on, allowing you to gradually upgrade your codebase to v6. To complete the upgrade process and remove the rxjs-compat dependency from your project,

我错过了什么吗?

最佳答案

您可能在应用程序中的某个位置使用旧式的“补丁”运算符。例如这样:

import 'rxjs/add/operator/combineLatest'

如果你想继续使用这种风格,那么你还需要安装rxjs-compat包。

无论如何,请考虑迁移到可管道操作符:

关于angular - 无法解析 'rxjs-compat/observable/combineLatest',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53865763/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com