sindresorhus/ora

Typescript compile successful but error on running the app

Zoro-6191 opened this issue · 1 comments

const ora_1 = __importDefault(require("ora"));
                              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module D:\Git\node_modules\ora\index.js from D:\Git\build\index.js not supported.
Instead change the require of D:\Git\node_modules\ora\index.js in D:\Git\build\index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (D:\Git\build\index.js:20:31) {
  code: 'ERR_REQUIRE_ESM'
}

Earlier I read that chalk had similar issue, but downgrading to a certain version helped. However can't find anything similar for ora

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

You can also use version 5 if you need CommonJS support.