Currently working on a TypeScript project that is set to target ES5, I am exploring the feasibility of incorporating async/await functionality.
Syntactically, the TypeScript compiler is able to transpile the code without issues. However, it has come to my attention that a polyfill for 'Promise' is required due to its absence in ES5.
My attempts to utilize the npm 'promise' package for this purpose have resulted in an error. When attempting to include it in the same file as an 'async/await' function, I received the following message:
Error: Duplicate identifier 'Promise.' The compiler reserves the name 'Promise' within the top-level scope of a module that contains async functions.
As a result, I am unsure of how to achieve the 'Promise' functionality necessary to avoid runtime errors.
Are there any possible workarounds or solutions to this issue? Your assistance would be greatly appreciated. Thank you!