1
votes

The custom Azure pipeline task that has the issue can be found here and has been created by following this tutorial. The task tests are working without any issue, so the task is actually running and calling my external package dependency.

After packaging and publishing the task on the VisualStudio Marketplace and using it in my Azure Devops Release Pipeline (using the default Hosted VS2017 agent) I get the following error output:

2019-05-28T06:03:34.4430730Z ##[error]Unhandled: Unexpected token function
2019-05-28T06:03:34.4438636Z ##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Unexpected token function
2019-05-28T06:03:34.4439433Z ##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Unexpected token function

The issue occurs when I call a 3rd-party npm package (like directline-jabber in this case). I suspect the node runtime is not accepting my async / await but when I output the node version on the build agent it outputs v10.15.3.

1

1 Answers

1
votes

The issue was caused by the package readdirp that heavily relies on the NodeJS filesystem (fs). I expect that those functions fail because they are either not supported or running behind the NodeJS version that is used in their tasks package.