JavaScript “Promise.prototype.finally() is not a function” error in Teams

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?

Answer:1

To answer the "why" question, Microsoft Teams uses Electron 1.7.1 (according to the ThirdPartyNotice.txt file located next to Teams.exe) and Promise.prototype.finally was added only in Electron 3.x.

Answer:2

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.

  1. Use Babel to transpile JavaScript from ES6 and ES7 down to ES5:

    How do I get Babel 6 to compile to ES5 javascript?

  2. Use TypeScript and target ES5 when compiling:

    Typescript- What is target in tsconfig?

  3. Use one of the many available polyfills:

    https://ourcodeworld.com/articles/read/316/top-5-best-javascript-promises-polyfills

Answer:3

I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...

I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...

  1. numberformat javascript locale
  2. number format javascript money
  3. number format javascript 2 decimal places
  4. number format javascript commas
  5. number format javascript decimal
  6. number format javascript currency
  7. number format javascript library
  8. number format javascript jquery
  9. number format javascript leading zero
  10. number format javascript php
  11. number format javascript example
  12. number format javascript function
  13. number format javascript input
  14. number format javascript regex
  15. number format javascript decimal places
  16. number_format javascript like php
  17. number format javascript pdf
  18. javascript numberformat comma
  19. javascript numberformat currency
  20. javascript numberformat style

I'm trying to create an admin template with a sidebar that can be toggled. I want it to just slide in and out and the content resize accordingly. I've tried everything I can think of and nothing works....

I'm trying to create an admin template with a sidebar that can be toggled. I want it to just slide in and out and the content resize accordingly. I've tried everything I can think of and nothing works....

  1. semantic ui collapsible sidebar

I have a requirement to allow the user to download the multiple images by checking the file and clicking the button. For now I have provided a link below every image to download. But I need to do ...

I have a requirement to allow the user to download the multiple images by checking the file and clicking the button. For now I have provided a link below every image to download. But I need to do ...

  1. make multiple image meme
  2. make multiple bootable image file
  3. how to make multiple image to pdf
  4. how to make multiple image in photoshop
  5. how to make multiple image slider
  6. make one image from multiple images
  7. image make multiple layers

I'm using a third party JavaScript library in a website with 20+ HTML pages each with its own JavaScript and CSS file. But the problem is if a new version is available to the library then, I have to ...

I'm using a third party JavaScript library in a website with 20+ HTML pages each with its own JavaScript and CSS file. But the problem is if a new version is available to the library then, I have to ...