DaTaobao Tech
Aug 16, 2022 · Backend Development
Understanding esModuleInterop: CommonJS vs ES Module in TypeScript
The article explains how toggling TypeScript's esModuleInterop flag changes import behavior between CommonJS and ES Module syntax, causing runtime errors like “TPS is not a constructor,” and offers fixes—either revert the flag and use namespace imports or enable it and use default imports.
CommonJSESModuleModuleResolution
0 likes · 7 min read