question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native ESM support, possibly requiring integration with ts-node

See original GitHub issue

In ts-node we released experimental support for native ECMAScript modules. To do this we needed to implement a custom resolve() loader hook. It is a copy-paste of node’s built-in resolver, tweaked for our needs.

https://github.com/TypeStrong/ts-node/issues/1007

Is native ESM support on your radar? Do you have thoughts on how best to implement it for tsconfig-paths? I expect we will need to coordinate, since node only supports a single loader hook.

I see that the compiler itself can perform these resolutions via ts.resolveModuleName. Do you use that internally, or do you do something else?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:26
  • Comments:8

github_iconTop GitHub Comments

7reactions
dobromyslovcommented, Dec 18, 2021
6reactions
cspotcodecommented, Feb 1, 2022

Closing in favor of https://github.com/TypeStrong/ts-node/pull/1585 which will add native path mapping support to ts-node.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - ECMAScript Modules in Node.js - TypeScript
Interoperating between the two module systems brings large challenges, with many new features to juggle; however, support for ESM in Node.js is now...
Read more >
ts-node - npm
This error is thrown by node when a module is require() d, but node believes it should execute as native ESM. This can...
Read more >
What does it take to support Node.js ESM? – The Guild
I have worked on all The Guild's libraries and graphql-js to support ESM. Here is how you can do it too.
Read more >
CommonJS vs native ECMAScript modules | ts-node
ts -node's ESM support is as stable as possible, but it relies on APIs which node can and will break in new versions...
Read more >
Node v13 / Jest / ES6 — native support for modules without ...
Yes, it is possible from jest@25.4.0 . From this version, there is a native support of esm, so you will not have to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found