Skip to content

No esModuleInterop and allowSyntheticDefaultImports

Compare
Choose a tag to compare
@ofrobots ofrobots released this 12 Jul 21:01
82ecc4e

This is a release with breaking changes. We no longer set the esModuleInterop and allowSyntheticDefaultImports in the default TypeScript config. These might be reasonable configurations for end-user application code, but for libraries these can be problematic. TypeScript users of such libraries must have these flags set as well for compilation to succeed. For example: googleapis/google-auth-library-nodejs#381.

There are two ways to deal with this breaking change:

  • (recommended) change code using synthetic imports (import fs from 'fs') back to using old style imports (import * as fs from 'fs').
  • Add "esModuleInterop": true to your local tsconfig.json.

Sorry for the churn.

Commits