Share via

The call to OfficeExtension.Promise of the Office JavaScript API has stopped working

Anonymous
2024-02-16T08:46:09+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 */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* Your use of this file is governed by the license terms for the Microsoft Office JavaScript (Office.js) API library: https://github.com/OfficeDev/office-js/blob/release/LICENSE.md

This file also contains the following Promise implementation (with a few small modifications):
    \* @overview es6-promise - a tiny implementation of Promises/A+.
    \* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
    \* @license   Licensed under MIT license
    \*            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
    \* @version   2.3.0

*/

THe error happens in office web browser clients but also in Windows Outlook clients.

Any help would be appreciated.

Microsoft 365 and Office | Install, redeem, activate | Other | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-19T11:52:15+00:00

    Hello again,

    it seems that the error was due to the special characters I included in the text of my question.

    I was now able to submit the question after removing some of the code regarding the headers of the failing library.

    Regards,

    Juan

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-02-19T07:42:59+00:00

    Hello Vince,

    thanks for your response, but when trying to post a question on the indicated page I got the error "Please fix the following issues to continue:

    • You are not authorized to make this response. If you believe this to be in error, please refresh the page and try again."

    I suppose that I need now to open a question so I can open a question...

    Regards,

    Juan

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-02-16T18:41:20+00:00

    Hello! Juan Cucala

    Thank you for posting in Microsoft Community

    It seems to me that you are having trouble with the Office JavaScript API for Outlook add-in, as much as I would love to help you with your concern however, it seems to me that your concern is way advance and will require more help with the experts. What I can suggest for you to do is to share your concern here to the Dev support Microsoft Office Dev Center | Office JavaScript APIs as they have the necessary resources when it comes to JavaScripting API and Add-ins for Office.

    We will also leave the thread open for any volunteer moderators to join in and share their opinion/suggestions to help you with your concern.

    Thank you,

    Vince

    Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments