Is there a bug in new Office Javascript API that fails on call to OfficeExtension.Promise?

Juan Cucala 0 Reputation points
2024-02-19T11:49:46.85+00:00

I 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 yesterday, 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". 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. Any help would be appreciated.

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.