Closed EthanRBrown closed 1 year ago
The problem is with your TS or ts-node config, not this package.
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
Thanks, @sindresorhus. That guide is very helpful, and answers some questions I've had about CJS->ESM conversion.
For anyone finding this, the problem was really ts-node
more than anything else: I switched to npx
and had no problems whatsoever.
I've used Ora in the past and liked it, so I didn't think twice about throwing it in a TS project I'm working on. An hour of frustration later, I'm giving up on it. I did try a minimum reproduction of the issue, which I'll describe here (I tried various versions back to 5.0.0 with the same results, so this isn't a recent issue).
Create
test.ts
:Attempt to run with
ts-node
(skipping type-checking...not the problem here):I also tried with a couple of "real" TypeScript configurations (i.e. not using
ts-node
), and experimented with themodule
type, and ESM flags, and nothing worked.I could tackle a PR myself, but I won't have time for a couple of weeks.