How to solve “can only be default-imported using the ‘esModuleInterop’ flag” in Visual Studio 2019?

A simple solution is to set "esModuleInterop": true in compilerOptions of your tsconfig.json file.

Example:

{
  "compilerOptions": {    
    "esModuleInterop": true
  }
}

Leave a Comment