The esModuleInterop
and module importing is inconsistent (and mandatory?) with tsx
#388
Closed
3 of 5 tasks
Labels
Precheck
Problem
I have a file
I have a // @ts-ignore on top of the default import, since TypeScript complains, rightly so since my
esModuleInterop: false
(the default):When I execute I get:
if you noticed,
worked, which is incosistent. I imported lodash normally (for my
esModuleInterop: false
) and deepmerge in an illegal way for my project, and these are the 2 that worked.But the legit
deepmerge({ deepmergeA: 1 }, { deepmergeB: 2 })
broke.In ts-node
work as expected (and the
deepmergeAsDefault
breaks as should).All my project is using non-default imports, and I don't want to enable
esModuleInterop
cause some library was breaking some time ago, and all my project is using the non-esModuleInterop
any way and works just fine with all other tooling, includingts-node
,jest
withts-jest
and as compiled js code.Is there any flag I'm missing that can accommodate this?
Expected behavior
To work like it does with all other tooling and respecting my ts-config.
Minimal reproduction URL
https://stackblitz.com/edit/node-34fss6?file=index.ts
Version
v3.14.0
Node.js version
20.8.0
Package manager
npm
Operating system
Linux
Contributions
The text was updated successfully, but these errors were encountered: