0

I have an app built with Durandal and use Weyland to build it. I have Weyland installed globally and when I run the command weyland build -c "path\to\config" locally it works and results in the following output

info jshint Linting 6 files.  
info jshint Passed for App/cart/config.js.  
info jshint Passed for App/cart/main.js.  
info jshint Passed for App/cart/services/datacontext.js.  
info jshint Passed for App/cart/viewmodels/cart.js.  
info jshint Passed for App/cart/viewmodels/nextsteps.js.  
info jshint Passed for App/cart/viewmodels/shell.js.  
info uglifyjs Uglifying 22 files.  
info uglifyjs Uglified App/cart/config.js.  
info uglifyjs Uglified App/cart/main.js.  
WARN: Dropping unused function argument c [null:22,32]

When I run the same sequence in Azure Dev Ops instead of the WARN I get the error:

ERR! uglifyjs TypeError: sys.error is not a function

info jshint Linting 6 files.
info jshint Passed for App/cart/config.js.  
info jshint Passed for App/cart/main.js.  
info jshint Passed for App/cart/services/datacontext.js.  
info jshint Passed for App/cart/viewmodels/cart.js.  
info jshint Passed for App/cart/viewmodels/nextsteps.js.  
info jshint Passed for App/cart/viewmodels/shell.js.  
info uglifyjs Uglifying 22 files.  
info uglifyjs Uglified App/cart/config.js.  
info uglifyjs Uglified App/cart/main.js.  
ERR! uglifyjs TypeError: sys.error is not a function

The stack trace:

ERR! uglifyjs TypeError: sys.error is not a function
ERR! uglifyjs     at Function.UglifyJS.AST_Node.warn_function (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\tools\node.js:42:9)
ERR! uglifyjs     at Function.AST_Node.warn (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\ast.js:110:18)
ERR! uglifyjs     at Compressor.warn (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\compress.js:81:27)
ERR! uglifyjs     at TreeTransformer.before (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\compress.js:956:44)
ERR! uglifyjs     at AST_Defun.transform (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\transform.js:61:35)
ERR! uglifyjs     at C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\transform.js:80:25
ERR! uglifyjs     at doit (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\utils.js:114:23)
ERR! uglifyjs     at MAP (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\utils.js:140:52)
ERR! uglifyjs     at do_list (C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\transform.js:79:16)
ERR! uglifyjs     at C:\npm\prefix\node_modules\weyland\node_modules\uglify-js\lib\transform.js:168:21

The build is being executed using the Command Line task.

Both my computer and the pipeline are configured with

Node v12.16.2 
NPM 6.14.4

Why would the Azure Pipeline VM fail to display a WARNING? How can I fix this?

Jonas Stawski
  • 6,682
  • 6
  • 61
  • 106

1 Answers1

0

Since you did not share the task definition you configured, I guess you encountered this error while the option "Fail on Standard Error" is checked.

enter image description here

Because I faced the same issue with you if I checked this option.

enter image description here

But, this unexpected issue will go away if I uncheck the option "Fail on Standard Error".

enter image description here

So to counter this issue, please ensure the option "Fail on Standard Error" of Command line task is unchecked.

Mengdi Liang
  • 17,577
  • 2
  • 28
  • 35
  • Thank you for the answer, but the problem doesn't go away. The only difference is that the task is not reported as failed. If you look at the second screenshot, the task still failed on line 73 and the weyland build doesn't actually complete – Jonas Stawski Sep 17 '20 at 19:42
  • @JonasStawski, Ohhh, that's me expect error. By the way, were you using Hosted agent or private agent? – Mengdi Liang Sep 21 '20 at 02:41
  • hosted agent within Azure DevOps – Jonas Stawski Sep 21 '20 at 22:19