【发布时间】:2020-05-07 05:33:19
【问题描述】:
我正在使用 Azure DevOps YAML 管道来构建/部署我的 Angular 9 应用程序。 YAML 包含一个 Powershell 脚本来构建它,如下所示
- powershell: |
$angularBuildConfiguration = "MyBuildConfig";
write-host "ng-build start";
ng build --prod --aot --configuration $angularBuildConfiguration;
write-host "ng-build end";
workingDirectory: '$(Build.SourcesDirectory)\...'
displayName: 'Build app - Angular app'
以上内容通过 Angular 构建,最后返回消息“ERROR in Cannot read property 'toLowerCase' of undefined”。
我已验证 workingDirectory 和 angularBuildConfiguration 参数具有预期的值 - 我也已将它们替换为硬编码值并获得相同的结果。如果我在构建服务器(实际运行 YAML 脚本的位置)上运行上面的 Powershell 脚本,则在预期的文件夹中构建失败并显示相同的错误消息,但是如果我在本地计算机上使用相同的脚本构建它会成功构建
我不知道这是否是一个 ng 构建问题,或者我的 Angular 9 项目中是否存在导致错误的东西 - 没有标记伴随错误消息的“关联”文件
有人有什么想法吗?
【问题讨论】:
-
我也有同样的问题。它甚至没有显示行号
-
我也有同样的问题。我通过删除 --prod 解决了这个问题,但这不是解决方案。
标签: angular azure-devops ng-build angular9