Promise.prototype.finally has been part of the ECMAScript specification for more than a year and gives no errors in most browsers.
When used within Teams desktop app, I see "Promise.prototype.finally() is not a function" error in console. Is there any documentation available on what can be used within a Teams app?
I can polyfill this function but wished to know about documentation on any other quirks or support on what to use?
Why is this issue caused in Teams desktop app and not the Teams web app?
To answer the "why" question, Microsoft Teams uses Electron 1.7.1 (according to the
ThirdPartyNotice.txt file located next to
Promise.prototype.finally was added only in Electron 3.x.
Even if Microsoft Teams got ES6 Promises working in desktop client it doesn't matter because Teams needs to run on IE11 which doesn't support them. There are a multiple of options available here.
Use TypeScript and target ES5 when compiling:
Typescript- What is target in tsconfig?
Use one of the many available polyfills: