Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: esModuleInterop: true without allowSyntheticDefaultImports: true is not the same #4156

Closed
simonhaenisch opened this issue May 30, 2023 · 0 comments · Fixed by #4429
Closed
Labels
🐛 Bug Confirmed Bug is confirmed

Comments

@simonhaenisch
Copy link

Version

29.0.3

Steps to reproduce

Have a tsconfig.json with "esModuleInterop": true but without "allowSyntheticDefaultImports": true.

Expected behavior

Only having esModuleInterop enabled behaves exactly the same as having both options enabled, because the docs for esModuleInterop say:

Emit additional JavaScript to ease support for importing CommonJS modules. This enables allowSyntheticDefaultImports for type compatibility.

See more: https://www.typescriptlang.org/tsconfig#esModuleInterop

Actual behavior

It's not the same. I encountered an error (TS2589: Type instantiation is excessively deep and possibly infinite) in my IDE but not when running the tests. Once I added

"allowSyntheticDefaultImports": true

to tsconfig.json, I would see the same error during the test run as well.

Debug log

Don't have one

Additional context

No response

Environment

System:
    OS: macOS 13.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
    Node: 18.16.0 - /usr/local/opt/node@18/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.2 - /usr/local/bin/npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Confirmed Bug is confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants