Office Javascript API is failing on call to OfficeExtension.Promise

46 Views Asked by At

We have developed an Outlook add-in that uses the Office Javascript API to access several properties of calendar items. We are following the recommendations and examples from MS, like exposed in the following article in section "Wrap common APIs in Promise-returning functions": https://learn.microsoft.com/en-us/office/dev/add-ins/develop/asynchronous-programming-in-office-add-ins

The thing is that the plugin has been working for a few months now until a few days ago, when we started receiving error reports from our clients.

The reported error is in the call to OfficeExtension.Promise, as per the following code:

return new OfficeExtension.Promise(function (resolve, reject) {
    try { 
        Office.context.mailbox.item.requiredAttendees.getAsync(function (asyncResult) { 
            // Put whatever here
        });
    }

which returns error: "46032ae441eb1f82ea83.js:703 Uncaught (in promise) TypeError: OfficeExtension.Promise is not a constructor".

We found that the falling library has the following header: Outlook Web specific API library osfweb version: 16.0.17313.15000 office-js-api version: 20240118.8

The error happens in office web browser clients but also in Windows Outlook clients, but it does not affect all clients or users.

It seems obvious that MS has made some changes in their library. We opened the question in some of their forums but we got no answer. We even opened a ticket on a paid subscription and their only response was ¨Your subscription accesses your complementary support which doesn’t cover Microsoft 365 developer issues¨.

Did anyone experience the same issue? Did you find a solution?

0

There are 0 best solutions below