-
-
Notifications
You must be signed in to change notification settings - Fork 27
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] Not working with ESM modules #134
Comments
Thanks for the report! I had a look at the Update: I have a fix ready, but it requires an upstream PR on |
Thanks @nonara. That was really quick. Appreciate your help. |
Since TypeStrong/ts-node#1439 has been merged, is there any other blocker to this issue? Appreciate your effort and contribution @nonara. |
No blocker, per se, but things have been incredibly busy. This is rolled into the upcoming new major release, which has a lot of changes. I'm working on wrapping that up and hope to have it out soon! |
Thanks @nonara. Will check this out. |
@xpuu I have moved on to using other libraries. I am hoping that when typescript releases their implementation supporting self-referencing package, we may have a more standard compliant way of handling this use case - moving away from relative imports. |
@xpuu Thanks for the kind words! v4 is close, but there are a few outstanding issues I need to work out. Mainly, I need to finish the tests. As many can understand in these unusual times, circumstances took me away from being able to do open source work for awhile. I'm very much looking forward to wrapping v4 and hoping to soon, but I need to get things stable first. I've been swamped on contract work, but I've just launched a firm, which will help me offload some of the work and eventually free me up to work on open source again. I do hope to be able to get this wrapped on one of the upcoming weekends, however. |
@nonara Just so you know, I'm covered for now (solved this using some weird custom loader). Your message about your current workload really resonates with me. Good luck! |
Hey @nonara, is there anything we can do to help with the release of v4? Would love to see it released as this transformer is the only way I've managed to handle NX path mappings at runtime without using esbuild. No ESM support is the only drawback. |
Hey everyone, until v4 is ready, if you make a PR we can review it and try to merge it to v3 |
@halfbakedsneed I appreciate the offer! ESM and replicating node's require behaviour is a tricky problem, but this is definitely long overdue. I finally got some time to set aside and revamp OSS. I just finished a rewrite of I have to do a few quick PR and issue closes for If you do want to help, feel free to have a look at the open branch and let me know if you think there's an area you feel you can take on. If memory serves, it was largely a matter of finishing tests, but I'll have to check again. |
Hey any update on this? |
I am trying this out with my
esm
module with following configurationtsconfig.tsnode.json
package.json
b.ts
a.ts
TS_NODE_PROJECT=tsconfig.tsnode.json node --loader ts-node/esm --es-module-specifier-resolution=node src/a.ts
throwsif I change import in
a.ts
to relative pathimport {b} from "./b"
, it works with the same command.When used with
commonjs
works by changingmodule
tocommonjs
undertsconfig
and removing"type": "module"
underpackage.json
with cliTS_NODE_PROJECT=tsconfig.tsnode.json ts-node src/a.ts
The text was updated successfully, but these errors were encountered: