Closed Rxann closed 2 years ago
This is not an ora problem, but it is a huge hassle to find a correct example of the typescript code. I have an example working, but I'm in transit today. I'm hoping to post it to GitHub tonight and will comment here once it is available.
Ora is a great project. I'm looking forward to getting the sample up so it can be used more easily.
Thank you so much and whenever you can upload the example that would be great!
Take a look at this boilerplate:
For me, it successfully gets TS and Ora play nice together.
https://github.com/jason-henriksen/typescript-with-esm-no-babel-boilerplate.git
Thank you for this!
I am just wondering if you know of any other alternatives to this?
This is not the place to document how to use ESM with TypeScript. It has nothing specifically to do with Ora.
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
... because roughly 10 people asking "how can I use Ora" clearly has nothing to do with Ora...?
The items under your "Related" section in your readme have nothing specifically to do with Ora either.
But whatever. Your project, your call.
@Rxann , I was only looking for a TypeScript-no-babel way to do a native ESM import. You can message me directly if you have some other specific question about that boiler plate, or make an issue on the boiler plate and I'll see what I can do to help.
Ok sounds good!
My workaround:
$ npm install ora@^3.2.0
$ npm install @types/ora --save-dev
May miss some features but the API is still pretty simple.
My 2cents on:
It has nothing specifically to do with Ora
Our codebase already uses ES modules, even in the same script. ora@6.0.0
is the only one causing trouble. Maybe adding a GitHub action step which compiles a typescript sample file can help.
Ok thank you!
When I try to use ora with typescript, I get an error when running the compiled file with node.
The error:
Is this a my code issue or an ESM issue?