TypeScript · Middle · Question 61 of 75
What does esModuleInterop fix?
import express from 'express'; // a CommonJS module- ✓Correct answer: Default-importing CommonJS modules in a way that matches how bundlers and Node handle them
- 2Converting ESM to CommonJS
- 3Importing JSON files
Explanation
Without it you'd need import * as express from 'express', which breaks when the module is callable.