Skip to content
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

typescript usage #214

Closed
dongalor opened this issue Jul 26, 2022 · 3 comments
Closed

typescript usage #214

dongalor opened this issue Jul 26, 2022 · 3 comments

Comments

@dongalor
Copy link

I'm having problem with using ora spinners in typescript. Is it possible to fix this problem:

Error [ERR_REQUIRE_ESM]: require() of ES Module

Using code right from example:

import ora from 'ora';

const spinner = ora('Loading unicorns').start();

setTimeout(() => {
        spinner.color = 'yellow';
        spinner.text = 'Loading rainbows';
}, 1000);
@yakov116
Copy link

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2022
@anis-marrouchi
Copy link

anis-marrouchi commented Dec 12, 2022

@dongalor please try this solution and let me know if it worked for you.
https://github.com/nooqta/esm-ts

@jebarjonet
Copy link

jebarjonet commented Jan 4, 2023

A solution is to use version v5.4.1 of this library instead of the latest version (v6.0.0 has the breaking change with ESM)

@sindresorhus all the work you published in useful libraries is awesome, but that ESM shift on some of them is a pain for many developers. I guess you are tired of reading this, but making those libraries easily usable would be even more awesome 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants