【问题标题】:Lit-Element - Types have separate declarations of a private propertyLit-Element - 类型具有私有属性的单独声明
【发布时间】:2020-12-23 12:19:57
【问题描述】:

试图编译一个使用 lit-element 和 lit-html 的 typescript 项目,并且对使用 lit-html 的其他项目有依赖关系,这给了我错误

.../lit-html/lib/parts").NodePart' is not assignable to type 'import(".../lit-html/lib/parts").NodePart'.
Types have separate declarations of a private property '__pendingValue'.

我正在使用 webpack@4.42.1 尝试编译项目。

有什么想法吗?

【问题讨论】:

    标签: lit-element lit-html


    【解决方案1】:

    将此添加到您的 tsconfig 以强制它为 lit-html 使用单一来源:

        "paths": {
          ...
          "lit-html": ["node_modules/lit-html"],
          "lit-html*": ["node_modules/lit-html/*"],
       
        }
    

    【讨论】:

      猜你喜欢
      • 2018-09-06
      • 2019-09-13
      • 1970-01-01
      • 2021-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-17
      • 1970-01-01
      相关资源
      最近更新 更多