freerangeeggs / PostToOffice365Connector

Azure DevOps Build and Release Extenstion to send a message to an Microsoft 365 connector, allowing you to notify users in Microsoft Teams and Office365 Groups.
MIT License
3 stars 3 forks source link

Unexpected token function #23

Closed jorgecensi closed 1 month ago

jorgecensi commented 2 months ago

Hi Brett, thanks for maintaining this extension.

I've noticed the following error after the last update. Could you guide me on how to troubleshoot this issue? Cheers

C:\agent\_work\_tasks\PostToOffice365Connector_de88fedd-bc2d-4045-b476-17d35a3fee55\1.0.307\task.js:20
        execute: async function () {
                       ^^^^^^^^

SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:160:9)
##[error]Exit code 1 returned from process: file name 'C:\agent\externals\node\bin\node.exe', arguments '"C:\agent\_work\_tasks\PostToOffice365Connector_de88fedd-bc2d-4045-b476-17d35a3fee55\1.0.307\task.js"'.
marciobarbato commented 2 months ago

Hey Brett, we notice the same issue on our pipelines, appreciate any guidance on how to troubleshoot it

sw-ms-jaykumarsamata commented 2 months ago

Getting same issue with your latest release on 13/07/2024. Azure DevOps Release pipeline stopped working. can you please fix and release as soon as possible.

image

SujithChowdari commented 2 months ago

Facing the same issue with out pipelines too

freerangeeggs commented 2 months ago

Hey gang. Yeah, it is failing out for everyone. My integration tests on this are a bit flakey as they take a few days to propagate out to the agents.

I'm looking into it and will get back to you.

martinvaner commented 1 month ago

Hello Brett, do you have any update regarding this issue? Thanks a lot.

DarthSonic commented 1 month ago

Hi, same for me:

2024-07-22T14:34:16.2868711Z ##[section]Starting: Post To Teams (on success)
2024-07-22T14:34:16.2875171Z ==============================================================================
2024-07-22T14:34:16.2875338Z Task         : Post to Office365 Connector
2024-07-22T14:34:16.2875452Z Description  : Sends a message to an Office365 connector.
2024-07-22T14:34:16.2875567Z Version      : 1.0.324
2024-07-22T14:34:16.2875644Z Author       : Brett McKenzie
2024-07-22T14:34:16.2875773Z Help         : See here to [access the connectors for either Microsoft Teams or Office 365](https://dev.outlook.com/Connectors)
2024-07-22T14:34:16.2875991Z ==============================================================================
2024-07-22T14:34:16.6172821Z D:\a\_tasks\PostToOffice365Connector_de88fedd-bc2d-4045-b476-17d35a3fee55\1.0.324\task.js:20
2024-07-22T14:34:16.6173647Z         execute: async function () {
2024-07-22T14:34:16.6174100Z                        ^^^^^^^^
2024-07-22T14:34:16.6192494Z 
2024-07-22T14:34:16.6196523Z SyntaxError: Unexpected token function
2024-07-22T14:34:16.6230370Z     at createScript (vm.js:56:10)
2024-07-22T14:34:16.6247327Z     at Object.runInThisContext (vm.js:97:10)
2024-07-22T14:34:16.6247908Z     at Module._compile (module.js:549:28)
2024-07-22T14:34:16.6248344Z     at Object.Module._extensions..js (module.js:586:10)
2024-07-22T14:34:16.6248792Z     at Module.load (module.js:494:32)
2024-07-22T14:34:16.6249201Z     at tryModuleLoad (module.js:453:12)
2024-07-22T14:34:16.6249610Z     at Function.Module._load (module.js:445:3)
2024-07-22T14:34:16.6250034Z     at Module.runMain (module.js:611:10)
2024-07-22T14:34:16.6250720Z     at run (bootstrap_node.js:394:7)
2024-07-22T14:34:16.6251122Z     at startup (bootstrap_node.js:160:9)
2024-07-22T14:34:16.7638125Z ##[error]Exit code 1 returned from process: file name 'C:\agents\3.241.0\externals\node\bin\node.exe', arguments '"D:\a\_tasks\PostToOffice365Connector_de88fedd-bc2d-4045-b476-17d35a3fee55\1.0.324\task.js"'.
2024-07-22T14:34:16.7646939Z ##[section]Finishing: Post To Teams (on success)
freerangeeggs commented 1 month ago

Hey friends, sorry for the late response.

This should be cleared up; I had reverted my changes and had seen telemetry so assumed that was all working.

Please note though, with this announcement from Microsoft killing off Connectors this task extension will soon stop working, I have seen that it no longer works on Connectors to Office365 Groups (old Office mailbox webhooks) and although extended, functionality will begin to not work for Teams soon enough. At that point, I'll be killing off the extension.

freerangeeggs commented 1 month ago

Hey friends, sorry for the late response.

This should be cleared up, I had reverted my changes and had seen telemetry so assumed that was all working.

jorgecensi commented 1 month ago

Thanks for your time mate. Regarding the connectors, wouldn't this extension work with the Teams workflows?

DarthSonic commented 1 month ago

I removed the extension and switched to Azure Logic App. Was no pain to migrate.

  1. create logic app in azure
  2. add workflow which receives http request (webhook) and sends team message
  3. add powershell script in azure devops pipeline which calls the new logic apps webhook