ESM loader not working with transpileOnly flag. #1721
Replies: 1 comment 3 replies
-
I'm guessing that You're probably hitting an issue where ts-node is somehow omitting that error in one code path and not another. This might be a ts-node quirk, but I believe the key takeaway is this: your TypeScript configuration raises this error, and any time the error is not there, you're simply getting lucky. This behavior should not be depended upon. You are getting that error for a reason, and you should read what it says and change your configuration accordingly. If you want a way to suppress individual diagnostic codes in ts-node, we do have an option for that: |
Beta Was this translation helpful? Give feedback.
-
Using the ESM loader without
transpileOnly
works fine, but breaks when usingtranspileOnly
. Here's the error.I understand that the error comes from TypeScript asking to install the
@next
version. However, I am little confused why disablingtranspileOnly
makes it work? Is there something I am not aware of?ts-node: ^10.7.0
typescript: ^4.6.3
Following is the
tsconfig.json
file.You can reproduce the issue by cloning this repo. https://github.com/thetutlage/ts-node-esm-transpile-only
npm install
npm start
Beta Was this translation helpful? Give feedback.
All reactions