I've been working on a simple Typescript file to get an understanding of Typescript which uses asynchronous functions to make API calls. For my program, these functions are executed when a certain button is clicked, and would use the fetch() function to grab a JSON object and display certain data from it on an HTML page. I have these functions as type Promise since they use async/await and don't return anything, yet when trying to compile with tsc it gives me the error
error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
I have gone into my tsconfig.json file to add ES2015 into lib, yet it still gives me this same error when trying to compile. Is there something I am doing wrong? I've also tried using both ES6 for lib and target but the same error happens.