I am using an Azure DevOps YAML pipeline to build/deploy my Angular 9 application. The YAML contains a Powershell script to build it as follows
- 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'
The above goes through the Angular build and at the end returns the message "ERROR in Cannot read property 'toLowerCase' of undefined".
I have verified that the workingDirectory and angularBuildConfiguration parameters have the values intended - I have also replaced them with hardcoded values and get the same result. If I run the Powershell script above on the build server (where the YAML script actually runs on), in the folder intended the build fails with the same error message, however if I build with the same script on my local machine it builds successfully
I don't know whether it is a ng build issue, or whether there is something within my Angular 9 project that causes the error - there is no 'associated' file that is flagged that accompanies the error message
Does anyone have any ideas ?