AngularJS Uncaught SyntaxError: Unexpected token <

I am using Azure DevOps Build Pipeline to build my AngularJS app with gulp and bower. When i run locally, everything works fine

  1. npm install

  2. bower install

  3. gulp build

However, i have now created a pipeline to build a docker container and publish to app service. When i load the service, it fails with a blank screen and the following in Chrome DevTools console:

Chrome DevTools console Errors

When i use DevTools sources to look at the files that have loaded for both this version that is not working through the pipelines, and a working version built locally on my laptop, the javascript files seem to have html “injected” into the ones not working:

HTML injected into JS (not working)

JS from locally built code (working)

The code from both comes from the same source code repo, and the steps are exactly the same between pipeline and command line. i am lost as to why the code is built incorrectly though the pipeline.

If anyone can help, would greatly appreciate it.
Thanks,
Steve

Source: StackOverflow