I basically detailed the issue in this comment: #155 (comment)
It's a chicken-and-egg-like problem:
module: 'commonjs'
, then if any TS files import ES Modules (indirectly in their dependency graph), then Node throws an error because CommonJS modules can not import ES Modules.module: 'esnext'
, then the errors from the previous point go away, but now the .js
file that is loading ts-node
and calling something like require('typescript-entry-point.ts')
will have a similar issue, because the call to require('typescript-entry-point.ts')
will try to load an ES Module..js
file into an ES Module, we can not convert require('typescript-entry-point.ts')
into import 'typescript-entry-point.ts'
because now ES Modules don't handle .ts
extensions (at least not out of the box, and it seems the old require hooks don't operate on these new identifiers)At the moment, I'm sort of stuck, because I have dependencies in my dependency tree that are ES Modules.
The only workaround I can think of is to compile everything to .js
files (ES Modules) and avoid to use ts-node.
I wonder if a combination of allowJs
and ignore
so that it compiles JS files would help. I haven't tried that yet.
danielkatz, fregante, dandv, durdenx, ben-ihealth and 141 more
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4