Skip to content

allowSyntheticDefaultImports not respected for export { default as Foo } from "./b" #62757

@andrewbranch

Description

@andrewbranch

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

After #62567, tests/cases/compiler/reexportMissingDefault4.ts and -5.ts should not have errors, since

  • esModuleInterop/allowSyntheticDefaultImports defaults to true
  • the target file is a declaration file

but they still error with the error that the target module b.d.ts has no default export. (While this error sounds reasonable, the rationale is that we don't know whether the declaration file corresponds to CommonJS or ESM under the circumstances, and if CommonJS, a default import is allowed to reference the whole module.exports symbol.) The bug is likely related to the export { default as Foo } from "./b" syntactic form, since reexportMissingDefault4.ts does export { default } from "./b" under similar settings and is correctly error-free.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions