I am trying to add an asynchronous function to a TypeScript project. The code is as follows:
chrome.tabs.onUpdated.addListener(async (id, c, t) => { ... });
TypeScript complains:
TS2705 error: async function or method in ES5 / ES3 requires the constructor "Promise". Make sure you have a declaration for the "Promise" constructor or specify "ES2015" in your -lib option
When I add lib: ['es2015'] to tsconfig, TypeScript starts complaining about all calls to console.log , saying that the console is undefined.
source share