【问题标题】:TypeScript compile error in underscore.d.ts on hosted build controller in Visual Studio OnlineVisual Studio Online 中托管构建控制器上 underscore.d.ts 中的 TypeScript 编译错误
【发布时间】:2014-08-27 20:33:33
【问题描述】:

我有一个连接到 Visual Studio Online 的 Azure 网站。连接两者时,Visual Studio Online 会在托管生成控制器上创建一个持续交付生成运行。此构建一直失败,在 underscore.d.ts(来自http://definitelytyped.org/ 的 TypeScript 类型定义)中出现单个 typescript 编译错误,内容如下:

\Scripts\typings\underscore\underscore.d.ts(2315,1): error TS2160: Build: A generic type may not reference its own with a Wrapped form of its own type parameters。

我们使用 TypeScript 1.0:

<TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>

项目在本地和我们的本地 TFS 构建服务器上构建都没有错误。我的猜测是问题出在 Visual Studio Online 中的 TypeScript 编译器版本。

我的问题是是否有解决此问题的方法。比如有没有。有条件地从构建中排除 underscore.d.ts 的可能性吗?

【问题讨论】:

标签: underscore.js typescript azure-devops definitelytyped


【解决方案1】:

一种解决方法是配置您自己的 TypeScript 编译器。 TypeScript 在 npm 中可用,并且使用适当的插件将 TypeScript 编译为 gruntgulp 很容易,作为两个示例。您可以将 npm 和 gulp/grunt 添加为预构建脚本或作为工作流程中的自定义操作。 (我已经使用 npm 和 grunt 将带有 r.js 优化的 TypeScript 自动编译到 Azure git 部署中。)

【讨论】:

    【解决方案2】:

    该错误现在是fixed。无需解决方法。在云端构建快乐!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-28
      • 2017-12-23
      • 2014-04-17
      • 2019-04-03
      • 2014-05-14
      • 2015-08-30
      相关资源
      最近更新 更多