typescript - 类型具有私有属性的单独声明 - urql 与 @urql
问题描述
看来我在@urql 和urql 之间存在类型冲突。我该如何解决这个问题?
Type 'import("d:/Development/ribbit/web/node_modules/@urql/core/dist/types/types").Exchange' is not assignable to type 'import("d:/Development/ribbit/web/node_modules/urql/node_modules/@urql/core/dist/types/types").Exchange'.
Types of parameters 'input' and 'input' are incompatible.
Type 'import("d:/Development/ribbit/web/node_modules/urql/node_modules/@urql/core/dist/types/types").ExchangeInput' is not assignable to type 'import("d:/Development/ribbit/web/node_modules/@urql/core/dist/types/types").ExchangeInput'.
Types of property 'client' are incompatible.
Type 'import("d:/Development/ribbit/web/node_modules/urql/node_modules/@urql/core/dist/types/client").Client' is not assignable to type 'import("d:/Development/ribbit/web/node_modules/@urql/core/dist/types/client").Client'.
Types have separate declarations of a private property 'onOperationStart'.ts(2322)
解决方案
我将多个版本的 @urql/exchange-graphcache 作为依赖项安装时遇到了这个问题。我通过简单地删除它们并重新安装它们来解决问题。
yarn remove @urql/exchange-graphcache
yarn add @urql/exchange-graphcache
推荐阅读
- android - kotlin 中的内联类和 UInt 可以安全使用吗?
- javascript - 跳出后将文本框文本更改为 xxxx
- python - 过滤允许连接到服务器的端口
- javascript - 使用 reactjs 更改当前页面位置
- r - 是否可以在某些语言环境中的 data.frame/data.table 中使用 unicode 列名?
- node.js - 服务端通过socket.io发送的数据显示异常
- javascript - date.setHours() 函数未将时间完全设置为零
- java - SAML 中的 SLO 是否应该适用于不同的浏览器?
- sh - 如何在 CloudBuild 中进行字符串比较?
- python - 在 Python 中实现数值积分方法