Closed digitalatcore closed 2 years ago
Ora is an ESM module and you need to output to ESM, not CommonJS. You also need TS 4.7. Alternatively, use version 5.
https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
I followed all the instructions on the link you provided but unfortunately still getting the same problem.
I'm also not able to use this in a TypeScript project. Getting this error. Maybe I'm just missing something simple here.
/Users/abrindle/Programming/X/node_modules/ts-node/src/index.ts:245
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts(3,17): error TS1471: Module 'ora' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
Upgrading typescript to v4.7.4 worked for me 👍
I've had the same issue. I've end it up creating a wrapper esm-ts. It works for me now.
am trying to build a CLI with nodejs and i tried to add some spinners in the command line using Ora. Unfortunately when i run tsc to build my JS 26 errors are thrown :
this my tsconfig file :
I tried importing the module in multiple ways but it always seems to fail the build. thank you.